Unformatted text preview:

CS162 Operating Systems and Systems Programming Lecture 2 History of the World Parts 1 5 Operating Systems Structures January 21 2010 Ion Stoica http inst eecs berkeley edu cs162 Goals for Today Operating Systems Structure History of Operating Systems Really a history of resource driven choices Operating Systems Organizations Abstractions and layering 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 1 21 10 Ion Stoica CS162 UCB Spring 2010 Lec 2 2 Joseph What if we didn t have an Operating System 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 Altair 8080 1 21 10 Ion Stoica CS162 UCB Spring 2010 Lec 2 3 Simple OS What if only one application 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 1 21 10 Ion Stoica CS162 UCB Spring 2010 Lec 2 4 MS DOS Layer Structure 1 21 10 Ion Stoica CS162 UCB Spring 2010 Lec 2 5 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 Lec 2 6 More complex OS Multiple Apps Full Coordination and Protection Manage interactions between different users Multiple programs running simultaneously Multiplex and protect Hardware Resources CPU Memory I O devices like disks printers etc Facilitator Still provides Standard libraries facilities Would this complexity make sense if there were only one application that you cared about 1 21 10 Ion Stoica CS162 UCB Spring 2010 Lec 2 7 Example Protecting Processes from Each Other Problem Run multiple applications in such a way that they are protected from one another Goal Keep User Programs from Crashing OS Keep User Programs from Crashing each other Keep Parts of OS from crashing other parts 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 1 21 10 Ion Stoica CS162 UCB Spring 2010 Lec 2 8 Address Translation Address Space A group of memory addresses usable by something Each program process and kernel has potentially different address spaces Address Translation Translate from Virtual Addresses emitted by CPU into Physical Addresses of memory Mapping often performed in Hardware by Memory Management Unit MMU Virtual Physical CPU 1 21 10 Addresses MMU Addresses Ion Stoica CS162 UCB Spring 2010 Lec 2 9 Example of Address Translation Data 2 Code Data Heap Stack Code Data Heap Stack Stack 1 Heap 1 Code 1 Stack 2 Prog 1 Virtual Address Space 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 Physical Address Space Ion Stoica CS162 UCB Spring 2010 Lec 2 10 Dual Mode Operation Hardware provides at least two modes Kernel mode or supervisor or protected User mode Normal programs executed Some instructions ops prohibited in user mode Example cannot modify page tables in user mode Attempt to modify Exception generated Transitions from user mode to kernel mode System Calls Interrupts Other exceptions 1 21 10 Ion Stoica CS162 UCB Spring 2010 Lec 2 11 UNIX System Structure User Mode Applications Standard Libs Kernel Mode Hardware 1 21 10 Ion Stoica CS162 UCB Spring 2010 Lec 2 12 Moore s Law Change Drives OS Change CPU MHz Cycles inst DRAM capacity Disk capacity Net bandwidth addr bits users machi ne Price 1981 10 3 10 128KB 2009 Quad 3 2G 0 25 0 5 6GB Factor 1 280 6 40 49 152 10MB 9600 b s 16 1 5TB 150 000 1 Gb s 110 000 64 4 10s 1 0 1 25 000 3 500 0 2 Typical academic computer 1981 vs 2009 1 21 10 Ion Stoica CS162 UCB Spring 2010 Lec 2 13 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 1 21 10 Ion Stoica CS162 UCB Spring 2010 Lec 2 14 Administrivia Waitlist Everyone has been let into the class Cs162 xx accounts 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 Nachos readers Will include lectures and printouts of all of the code Video Screencast archives available off lectures page Just click on the title of a lecture for webcast Only works for lectures that I have already given 1 21 10 Ion Stoica CS162 UCB Spring 2010 Lec 2 15 Administriva Time for Project Signup 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 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 Due Friday 1 28 by 11 59pm Section Time Location 101 W 10 00A11 00A 102 W 2 00P 3 00P 1 21 10 2 Evans 75 Evans Ion Stoica CS162 UCB Spring 2010 TA Matei Zaharia Andy Konwinski Lec 2 16 Academic Dishonesty Policy 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 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 and the Department Chair in writing of the incident the action taken if any and the student s right to appeal to the Chair of the


View Full Document

Berkeley COMPSCI 162 - History of the World Parts 1—5 Operating Systems Structures

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 History of the World Parts 1—5 Operating Systems Structures 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 History of the World Parts 1—5 Operating Systems Structures 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?