1 / 13

Pre- processor ( cpp )

printf.o. Pre- processor ( cpp ). Compiler ( cc1 ). Assembler ( as ). Linker ( ld ). hello.c. hello.i. hello.s. hello.o. hello. Source program (text). Assembly program (text). Modified source program (text). Relocatable object programs (binary). Executable object

ldwayne
Download Presentation

Pre- processor ( cpp )

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. printf.o Pre- processor (cpp) Compiler (cc1) Assembler (as) Linker (ld) hello.c hello.i hello.s hello.o hello Source program (text) Assembly program (text) Modified source program (text) Relocatable object programs (binary) Executable object program (binary)

  2. CPU Register file ALU PC System bus Memory bus Main memory Bus interface I/O bridge I/O bus Expansion slots for other devices such as network adapters USB controller Graphics adapter Disk controller Mouse Keyboard Display Disk hello executable stored on disk

  3. CPU Register file ALU PC System bus Memory bus Main memory "hello" Bus interface I/O bridge I/O bus Expansion slots for other devices such as network adapters USB controller Graphics adapter Disk controller Mouse Keyboard Display Disk User types "hello"

  4. CPU Register file ALU PC System bus Memory bus Main memory "hello,world\n" Bus interface I/O bridge hello code I/O bus Expansion slots for other devices such as network adapters USB controller Graphics adapter Disk controller Mouse Keyboard Display Disk hello executable stored on disk

  5. CPU Register file ALU PC System bus Memory bus Main memory "hello,world\n" Bus interface I/O bridge hello code I/O bus Expansion slots for other devices such as network adapters USB controller Graphics adapter Disk controller Mouse Keyboard Display Disk hello executable stored on disk "hello,world\n"

  6. CPU chip Register file L1 cache (SRAM) ALU Cache bus System bus Memory bus Main memory (DRAM) L2 cache (SRAM) Bus interface Memory bridge

  7. L1 cache holds cache lines retrieved from the L2 cache. L2 cache holds cache lines retrieved from memory. Main memory holds disk blocks retrieved from local disks. Local disks hold files retrieved from disks on remote network servers. L0: Smaller, faster, and costlier (per byte) storage devices Registers CPU registers hold words retrieved from cache memory. On-chip L1 cache (SRAM) L1: Off-chip L2 cache (SRAM) L2: Main memory (DRAM) L3: Larger, slower, and cheaper (per byte) storage devices Local secondary storage (local disks) L4: Remote secondary storage (distributed file systems, Web servers) L5:

  8. Application programs Software Operating system Processor Main memory I/O devices Hardware

  9. Processes Virtual memory Files Processor Main memory I/O devices

  10. shell process hello process Time Application code Context switch OS code Application code Context switch OS code Application code

  11. Memory invisible to user code 0xffffffff Kernel virtual memory 0xc0000000 User stack (created at runtime) Memory mapped region for shared libraries printf() function 0x40000000 Run-time heap (created at runtime by malloc) Read/write data Loaded from the hello executable file Read-only code and data 0x08048000 Unused 0

  12. CPU chip Register file ALU PC System bus Memory bus Main memory Bus interface I/O bridge Expansion slots I/O bus USB controller Network adapter Graphics adapter Disk controller Mouse Keyboard Monitor Disk Network

  13. 2. Client sends "hello" string to telnet server 1. User types "hello" at the keyboard 3. Server sends "hello" string to the shell, which runs the hello program, and sends the output to the telnet server Local telnet client Remote telnet server 4. Telnet server sends "hello, world\n" string to client 5. Client prints "hello, world\n" string on display

More Related