Unformatted text preview:

Goals for Today CS162 Operating Systems and Systems Programming Lecture 2 Operating Systems Structure History of Operating Systems Really a history of resource driven choices Operating Systems Organizations Abstractions and layering History of the World Parts 1 5 Operating Systems Structures January 21 2010 Ion Stoica http inst eecs berkeley edu cs162 Note Some slides and or pictures in the following are adapted from slides 2005 Silberschatz Galvin and Gagne Many slides generated from lecture notes by Joseph 1 21 10 What if we didn t have an Operating System Ion Stoica CS162 UCB Spring 2010 Lec 2 2 Simple OS What if only one application Source Code Compiler Object Code Hardware How do you get object code onto the hardware How do you print out the answer Once upon a time had to Toggle in program in binary and read out answer from LED s Examples Very early computers Early PCs Embedded controllers elevators cars etc OS becomes just a library of standard services Standard device drivers Interrupt handlers Math libraries Altair 8080 1 21 10 Ion Stoica CS162 UCB Spring 2010 1 21 10 Lec 2 3 Page 1 Ion Stoica CS162 UCB Spring 2010 Lec 2 4 MS DOS Layer Structure More thoughts on Simple OS What about Cell phones Xboxes etc Is this organization enough Can OS be encoded in ROM Flash ROM Does OS have to be software Can it be Hardware Custom Chip with predefined behavior Are these even OSs 1 21 10 Ion Stoica CS162 UCB Spring 2010 1 21 10 Lec 2 5 More complex OS Multiple Apps Ion Stoica CS162 UCB Spring 2010 Lec 2 6 Example Protecting Processes from Each Other Full Coordination and Protection Problem Run multiple applications in such a way that they are protected from one another Goal Manage interactions between different users Multiple programs running simultaneously Multiplex and protect Hardware Resources Keep User Programs from Crashing OS Keep User Programs from Crashing each other Keep Parts of OS from crashing other parts CPU Memory I O devices like disks printers etc Facilitator Some of the required Mechanisms Still provides Standard libraries facilities Address Translation Dual Mode Operation Would this complexity make sense if there were only one application that you cared about Simple Policy Programs are not allowed to read write memory of other Programs or of Operating System 1 21 10 Ion Stoica CS162 UCB Spring 2010 1 21 10 Lec 2 7 Page 2 Ion Stoica CS162 UCB Spring 2010 Lec 2 8 Address Translation 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 1 21 10 Ion Stoica CS162 UCB Spring 2010 1 21 10 Lec 2 9 Dual Mode Operation Physical Address Space Ion Stoica CS162 UCB Spring 2010 Lec 2 10 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 1 21 10 Ion Stoica CS162 UCB Spring 2010 1 21 10 Lec 2 11 Page 3 Ion Stoica CS162 UCB Spring 2010 Lec 2 12 Moore s Law Change Drives OS Change CPU MHz Cycles inst 1981 10 3 10 2009 Quad 3 2G 0 25 0 5 Factor 1 280 6 40 DRAM capacity 128KB 6GB 49 152 Disk capacity 10MB 1 5TB 150 000 Net bandwidth 9600 b s 1 Gb s 110 000 addr bits 16 64 4 users machine 10s 1 0 1 Price 25 000 3 500 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 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 2009 1 21 10 Ion Stoica CS162 UCB Spring 2010 1 21 10 Lec 2 13 Administrivia 4 5 members to a group All members of a group should be in same discussion section If you want to change your discussion section please send a request to cs162 staff lists berkeley edu Request are not guaranteed to be accommodated as we need to balance the section enrollment Send your request by Monday 1 25 11 59 Make sure you got an account form We have more forms for those of you who didn t get one If you haven t logged in yet you need to do so Watch Group Section Assignment Link for final assignments by Tuesday 1 26 Next you ll pick your group we ll tell you how to do next Tuesday Nachos readers Will include lectures and printouts of all of the code Video Screencast archives available off lectures page Due Friday 1 28 by 11 59pm Just click on the title of a lecture for webcast Only works for lectures that I have already given Ion Stoica CS162 UCB Spring 2010 Lec 2 14 Administriva Time for Project Signup Waitlist Everyone has been let into the class Cs162 xx accounts 1 21 10 Ion Stoica CS162 UCB Spring 2010 Section 101 Time W 10 00A 11 00A Location 2 Evans TA Matei Zaharia 102 W 2 00P 3 00P 75 Evans Andy Konwinski 103 W 3 00P 4 00P 2 Evans Ben Hindman 1 21 10 Lec 2 15 Page 4 Ion Stoica CS162 UCB Spring 2010 Lec 2 16 Academic Dishonesty Policy Babbage s Mechanical Computer 1822 Copying all or part of another person s work or using reference material not specifically allowed are forms of cheating and will not be tolerated A student involved in an incident of cheating will be notified by the instructor and the following policy will apply Problem compute numerical tables http www eecs berkeley edu Policies acad dis shtml The instructor may take actions such as require repetition of the subject work assign an F grade or a zero grade to the subject work for serious offenses assign an F grade for the course The instructor must inform the student


View Full Document

Berkeley COMPSCI 162 - Lecture Notes

Documents in this Course
Lecture 1

Lecture 1

12 pages

Nachos

Nachos

41 pages

Security

Security

39 pages

Load more
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?