Chapter 1: A Tour of Computer Systems Bryant & O’Hallaron
Pre- processor (cpp) Compiler (cc1) Assembler (as) Linker (ld) printf.o Pre- processor (cpp) Compiler (cc1) Assembler (as) Linker (ld) hello.c hello.i hello.s hello.o hello Source program (text) Modified source program (text) Assembly program (text) Relocatable object programs (binary) Executable object program (binary) Figure 1.3: The compilation system. compilation.ppt
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 Figure 1.4: Hardware organization of a typical system. hardware.ppt Mouse Keyboard Display Disk hello executable stored on disk
CPU Register file ALU PC System bus Memory bus Main memory Bus interface I/O bridge "hello" I/O bus Expansion slots for other devices such as network adapters USB controller Graphics adapter Disk controller Figure 1.5: Reading the hello command from the keyboard. keyboardread.ppt Mouse Keyboard Display Disk User types "hello"
CPU Register file ALU PC System bus Memory bus Main memory Bus interface I/O bridge "hello,world\n" hello code I/O bus Expansion slots for other devices such as network adapters USB controller Graphics adapter Disk controller Figure 1.6: Loading the executable from disk into main memory. helloload.ppt Mouse Keyboard Display Disk hello executable stored on disk
CPU Register file ALU PC System bus Memory bus Main memory Bus interface I/O bridge "hello,world\n" hello code I/O bus Expansion slots for other devices such as network adapters USB controller Graphics adapter Disk controller Figure 1.7: Writing the output string from memory to the display. displaywrite.ppt Mouse Keyboard Display Disk hello executable stored on disk "hello,world\n"
CPU chip Register file ALU Cache memories System bus Memory bus Main Bus interface I/O bridge Figure 1.8: Cache memories. cachebus.ppt
Local secondary storage (local disks) Regs Smaller, faster, and costlier (per byte) storage devices CPU registers hold words retrieved from cache memory. L1: L1 cache (SRAM) L1 cache holds cache lines retrieved from the L2 cache. L2 cache (SRAM) L2: L2 cache holds cache lines retrieved from L3 cache L3: L3 cache (SRAM) L3 cache holds cache lines retrieved from memory. Larger, slower, and cheaper (per byte) storage devices L4: Main memory (DRAM) Main memory holds disk blocks retrieved from local disks. Figure 1.9: An example of a memory hierarchy. memhier.ppt L5: Local secondary storage (local disks) Local disks hold files retrieved from disks on remote network servers. L6: Remote secondary storage (distributed file systems, Web servers)
Application programs Software Operating system Processor Main memory I/O devices Hardware Figure 1.10: Layered view of a computer system. layers.ppt
Processes Virtual memory Files Processor Main memory I/O devices Figure 1.11: Abstractions provided by an operating system. abstractions-os.ppt
Process A Process B Time User code read Context switch Kernel code Disk interrupt Context switch Kernel code Return from read User code Figure 1.12: Process context switching. switch.ppt
Memory mapped region for shared libraries printf function invisible to user code Kernel virtual memory User stack (created at runtime) Memory mapped region for shared libraries printf function Run-time heap (created by malloc) Read/write data Figure 1.13: Process virtual address space. rtimage.ppt Loaded from the hello executable file Read-only code and data 0x08048000 (32) 0x00400000 (64)
Network adapter Network CPU chip Register file ALU PC System bus Memory bus Main memory Bus interface I/O bridge Expansion slots I/O bus USB controller Graphics adapter Disk controller Network adapter Figure 1.14: A network is another I/O device. nethost.ppt Mouse Keyboard Monitor Disk Network
string to telnet server 3. Server sends "hello" Local telnet client Remote server 2. Client sends "hello" string to telnet server 3. Server sends "hello" string to the shell, which runs the hello program, and passes the output to the telnet server 4. Telnet server sends "hello, world\n" string to client 5. Client prints "hello, world\n" string on display 1. User types "hello" at the keyboard Figure 1.15: Using telnet to run hello remotely over a network. telnet.ppt
All processors Multiprocessors Multi- core Hyper- threaded Uniprocessors Figure 1.16: Categorizing different processor configurations. processors.ppt
… Processor package Core 0 Core 3 Regs Regs L1 d-cache L1 i-cache L1 L2 unified cache L2 unified cache L3 unified cache (shared by all cores) Figure 1.17: Intel Core i7 organization. corei7caches.ppt Main memory
Virtual machine Processes Instruction set architecture Virtual memory Files Operating system Processor Main memory I/O devices Figure 1.18: Some abstractions provided by a computer system. abstractions-multi.ppt