Review Virtual Machine Abstraction CS162 Operating Systems and Systems Programming Lecture 2 Application Operating System Hardware History of the World Parts 1 5 Operating Systems Structures Virtual Machine Interface Physical Machine Interface Software Engineering Problem Turn hardware software quirks what programmers want need Optimize for convenience utilization security reliability etc September 3rd 2008 Prof John Kubiatowicz http inst eecs berkeley edu cs162 For Any OS area e g file systems virtual memory networking scheduling What s the hardware interface physical reality What s the application interface nicer abstraction 9 03 08 Goals for Today Kubiatowicz CS162 UCB Fall 2008 Lec 2 2 Example Protecting Processes from Each Other Finish Protection Example History of Operating Systems Problem Run multiple applications in such a way that they are protected from one another Goal Really a history of resource driven choices Keep User Programs from Crashing OS Keep User Programs from Crashing each other Keep Parts of OS from crashing other parts Operating Systems Structures Operating Systems Organizations Abstractions and layering Some of the required Mechanisms Address Translation Dual Mode Operation Simple Policy Programs are not allowed to read write memory of other Programs or of Operating System Note Some slides and or pictures in the following are adapted from slides 2005 Silberschatz Galvin and Gagne Gagne Many slides generated from lecture notes by Joseph 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 3 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 4 Example Address Translation Example Example of Address Translation Address Space Address Translation Translate from Virtual Addresses emitted by CPU into Physical Addresses of memory Mapping often performed in Hardware by Memory Management Unit MMU CPU Virtual Addresses MMU Data 2 Code Data Heap Stack A group of memory addresses usable by something Each program process and kernel has potentially different address spaces Heap 1 Code 1 Stack 2 Prog 1 Virtual Address Space 1 Physical Addresses Code Data Heap Stack Stack 1 Prog 2 Virtual Address Space 2 Data 1 Heap 2 Code 2 OS code Translation Map 1 OS data Translation Map 2 OS heap Stacks 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 5 9 03 08 Example Dual Mode Operation Physical Address Space Kubiatowicz CS162 UCB Fall 2008 Lec 2 6 UNIX System Structure Hardware provides at least two modes Kernel mode or supervisor or protected User mode Normal programs executed User Mode Some instructions ops prohibited in user mode Example cannot modify page tables in user mode Applications Standard Libs Attempt to modify Exception generated Transitions from user mode to kernel mode Kernel Mode System Calls Interrupts Other exceptions Hardware 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 7 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 8 Moore s Law Change Drives OS Change CPU MHz Cycles inst 1981 10 3 10 2006 3200x4 0 25 0 5 Factor 1 280 6 40 DRAM capacity 128KB 4GB 32 768 Disk capacity 10MB 1TB 100 000 Net bandwidth 9600 b s 1 Gb s 110 000 addr bits 16 32 2 users machine 10s 1 0 1 Price 25 000 4 000 0 2 Moore s law effects Nothing like this in any other area of business Transportation in over 200 years 2 orders of magnitude from horseback 10mph to Concorde 1000mph Computers do this every decade at least until 2002 What does this mean for us Techniques have to vary over time to adapt to changing tradeoffs I place a lot more emphasis on principles The key concepts underlying computer systems Less emphasis on facts that are likely to change over the next few years Let s examine the way changes in MIP has radically changed how OS s work Typical academic computer 1981 vs 2006 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 9 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 10 History Phase 1 1948 1970 Hardware Expensive Humans Cheap Dawn of time ENIAC 1945 1955 When computers cost millions of s optimize for more efficient use of the hardware Lack of interaction between user and computer User at console one user at a time Batch monitor load program run print Optimize to better use hardware The machine designed by Drs Eckert and Mauchly was a monstrosity When it was finished the ENIAC filled an entire room weighed thirty tons and consumed two hundred kilowatts of power http ei cs vt edu history ENIAC Richey HTML 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 11 When user thinking at console computer idle BAD Feed computer batches and make users wait Autograder for this course is similar No protection what if batch program has bug 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 12 History Phase 1 late 60s early 70s Data channels Interrupts overlap I O and compute Core Memories 1950s 60s DMA Direct Memory Access for I O devices I O can be completed asynchronously The first magnetic core memory from the IBM 405 Alphabetical Accounting Machine Multiprogramming several programs run simultaneously Small jobs not delayed by large jobs More overlap between I O and CPU Need memory protection between programs and or OS Complexity gets out of hand Multics announced in 1963 ran in 1969 Core Memory stored data as magnetization in iron rings Iron cores woven into a 2 dimensional mesh of wires Origin of the term Dump Core Rumor that IBM consulted Life Saver company See http www columbia edu acis history core html 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 13 1777 people contributed to Multics 30 40 core dev Turing award lecture from Fernando Corbat key researcher On building systems that will fail OS 360 released with 1000 known bugs APARs Anomalous Program Activity Report OS finally becomes an important science How to deal with complexity UNIX based on Multics but vastly simplified 9 03 08 A Multics System Circa 1976 1973 1 7 Mbit sq in 140 MBytes We usually ran the machine with doors open so the operators could see the AQ register display which gave you an idea of the machine load and for convenient access to the EXECUTE button which the operator would push to enter BOS if the machine crashed http www multicians org multics stories html Kubiatowicz CS162 UCB Fall 2008 Lec 2 14 Early Disk History The 6180 at MIT IPC skin doors open circa 1976 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 15 1979 7 7 Mbit sq in 2 300 MBytes Contrast Seagate 1TB 164 GB SQ in 3 in disk 4 platters 9 03 08 Kubiatowicz CS162 UCB Fall 2008 Lec 2 16 Administrivia Administriva Time for Project Signup Cs162 xx accounts Make sure you got an
View Full Document
Unlocking...