Presentation is loading. Please wait.

Presentation is loading. Please wait.

University of Amsterdam Computer Systems – a guided tour Arnoud Visser 1 Computer Systems A guided Tour.

Similar presentations


Presentation on theme: "University of Amsterdam Computer Systems – a guided tour Arnoud Visser 1 Computer Systems A guided Tour."— Presentation transcript:

1 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 1 Computer Systems A guided Tour

2 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 2 Programmable devices #include int main() { printf("hello, world\n"); }

3 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 3 Compilation System Normally, you don’t see the intermediate results Pre- processor ( cpp ) hello.i Compiler ( cc1 ) hello.s Assembler ( as ) hello.o Linker ( ld ) hellohello.c Source program (text) Modified source program (text) Assembly program (text) Relocatable object programs (binary) Executable object program (binary) printf.o

4 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 4 Machine code Load Store Update Read Write Main memory Register file I/O bridge Register file ALU

5 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 5 Execution System Each character is read into a register, and stored in the main memory Main memory I/O bridge Bus interface ALU Register file CPU System busMemory bus Disk controller Graphics adapter USB controller MouseKeyboardDisplay Disk I/O bus Expansion slots for other devices such as network adapters PC "hello" User types "hello"

6 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 6 Execution System After, the machine code is read into the main memory Main memory I/O bridge Bus interface ALU Register file CPU System busMemory bus Disk controller Graphics adapter USB controller MouseKeyboardDisplay Disk I/O bus Expansion slots for other devices such as network adapters hello executable stored on disk PC hello code "hello,world\n"

7 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 7 Execution System The machine instructions copy.ascii data to the registers, and from there to the display Main memory I/O bridge Bus interface ALU Register file CPU System busMemory bus Disk controller Graphics adapter USB controller MouseKeyboardDisplay Disk I/O bus Expansion slots for other devices such as network adapters hello executable stored on disk PC hello code "hello,world\n"

8 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 8 Cache Every cache level is 5 to 10 faster Main memory (DRAM) Memory bridge Bus interface L2 cache (SRAM) ALU Register file CPU chip Cache busSystem busMemory bus L1 cache (SRAM)

9 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 9 Memory hierarchy Registers On-chip L1 cache (SRAM) Main memory (DRAM) Local secondary storage (local disks) Larger, slower, and cheaper (per byte) storage devices Remote secondary storage (distributed file systems, Web servers) Local disks hold files retrieved from disks on remote network servers. Main memory holds disk blocks retrieved from local disks. Off-chip L2 cache (SRAM) L1 cache holds cache lines retrieved from the L2 cache. CPU registers hold words retrieved from cache memory. L2 cache holds cache lines retrieved from memory. L0: L1: L2: L3: L4: L5: Smaller, faster, and costlier (per byte) storage devices

10 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 10 Operating system Shield hardware (bi-directional) Allows multiple programs access to the computer Application programs ProcessorMain memoryI/O devices Operating system Software Hardware ProcessorMain memoryI/O devices Processes Files Virtual memory

11 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 11 Context switches Each process has the illusion that it has exclusive use of the main memory shell process hello process Application code Time Context switch Context switch OS code Application code OS code Application code

12 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 12 Virtual address space C is the language for system-level programming C-pointers are common source for errors Kernel virtual memory Memory mapped region for shared libraries Run-time heap (created at runtime by malloc) User stack (created at runtime) Unused 0 Memory invisible to user code 0xc0000000 0x08048000 0x40000000 Read/write data Read-only code and data Loaded from the hello executable file printf() function 0xffffffff

13 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 13 Conclusion System is more than hardware Hardware and system software are heavily intertwined A programmer meets the system at many different levels

14 University of Amsterdam Computer Systems – a guided tour Arnoud Visser 14 Assignment 2 Make a makefile for the source-file ‘hello.c’, with implicit rules and following the general conventions “hello world” http://www.gnu.org/software/make/manual/


Download ppt "University of Amsterdam Computer Systems – a guided tour Arnoud Visser 1 Computer Systems A guided Tour."

Similar presentations


Ads by Google