CS162 Operating Systems and Systems Programming Lecture 1 What is an Operating System August 29 2005 Prof John Kubiatowicz http inst eecs berkeley edu cs162 Who am I Professor John Kubiatowicz Prof Kubi Background in Hardware Design Alewife project at MIT Designed CMMU Modified SPAR C processor Helped to write operating system Background in Operating Systems Worked for Project Athena MIT OS Developer device drivers network file systems Worked on Clustered High Availability systems CLAM Associates Peer to Peer OceanStore project Store your data for 1000 years Tapestry and Bamboo Find you data around globe Quantum Computing Well this is just cool but probably not apropos 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 2 Goals for Today What is an Operating System And what is it not Examples of Operating Systems design Why study Operating Systems Oh and How does this class operate Note Some slides and or pictures in the following are adapted from slides 2005 Silberschatz Galvin and 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 3 Gagne Rapid Underlying Technology Change Cramming More Components onto Integrated Circuits Gordon Moore Kubiatowicz Electronics 1965 CS162 UCB Fall 2005 8 29 05 Lec 1 4 Computing Devices Everywhere 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 5 Computer System Organization Computer system operation One or more CPUs device controllers connect through common bus providing access to shared memory Concurrent execution of CPUs and devices competing for memory cycles 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 6 Functionality comes with great complexity Pentium III Chipset Proc Caches Busses Memory adapters Controllers I O Devices 8 29 05 Disks Displays Keyboards Networks Kubiatowicz CS162 UCB Fall 2005 Lec 1 7 Sample of Computer Architecture Topics Input Output and Storage Disks WORM Tape Memory Hierarchy L2 Cache VLSI L1 Cache Instruction Set Architecture Emerging Technologies Interleaving Bus protocols Coherence Bandwidth Latency Network Communication Addressing Protection Exception Handling Other Processors DRAM RAID Pipelining Hazard Resolution Pipelining and Instruction Superscalar Reordering Level Parallelism Prediction Speculation Vector Dynamic Compilation 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 8 Example Some Mars Rover Requirements Serious hardware limitations complexity 20Mhz powerPC processor 128MB of RAM cameras scientific instruments batteries solar panels and locomotion equipment Many independent processes work together Can t hit reset button very easily Must reboot itself if necessary Always able to receive commands from Earth Individual Programs must not interfere Suppose the MUT Martian Universal Translator Module buggy Better not crash antenna positioning software Further all software may crash occasionally Automatic restart with diagnostics sent to Earth Periodic checkpoint of results saved Certain functions time critical Need to stop before hitting something Must track orbit of Earth for communication 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 9 How do we tame complexity Every piece of computer hardware different Different CPU Pentium PowerPC ColdFire ARM MIPS Different amounts of memory disk Different types of devices Mice Keyboards Sensors Cameras Fingerprint readers Different networking environment Cable DSL Wireless Firewalls Questions Does the programmer need to write a single program that performs many independent activities Does every program have to be altered for every piece of hardware Does a faulty program crash everything Does every program have access to all hardware 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 10 OS Tool Virtual Machine Abstraction Application Operating System Virtual Machine Interface Physical Machine Interface Hardware Software Engineering Problem Turn hardware software quirks what programmers want need Optimize for convenience utilization security reliability etc 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 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 11 Interfaces Provide Important Boundaries software instruction set hardware Why do interfaces look the way that they do History Functionality Stupidity Bugs Management CS152 Machine interface CS160 Human interface Should responsibilities be pushed across boundaries RISC architectures Graphical Interfaces 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 12 Virtual Machines Software emulation of an abstract machine Make it look like hardware has features you want Programs from one hardware OS on another one Programming simplicity Each process thinks it has all memory CPU time Each process thinks it owns all devices Different Devices appear to have same interface Device Interfaces more powerful than raw hardware Bitmapped display windowing system Ethernet card reliable ordered networking TCP IP Fault Isolation Processes unable to directly impact other processes Bugs cannot crash whole machine Protection and Portability Java interface safe and stable across many platforms 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 13 Four Components of a Computer System Definition An operating system implements a virtual machine that is hopefully easier and safer to program and use than the raw 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 14 hardware Virtual Machines con t Layers of OSs Useful for OS development When OS crashes restricted to one VM Can aid testing programs on other OSs 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 15 Nachos Virtual OS Environment You will be working with Nachos Simulation environment Hardware interrupts I O Execution of User Programs running on this platform 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 16 What does an Operating System do Silerschatz and Gavin An OS is Similar to a government Begs the question does a government do anything useful by itself Coordinator and Traffic Cop Manages all resources Settles conflicting requests for resources Prevent errors and improper use of the computer Facilitator Provides facilities that everyone needs Standard Libraries Windowing systems Make application programming easier faster less errorprone Some features reflect both tasks E g File system is needed by everyone Facilitator But File system must be Protected Traffic Cop 8 29 05 Kubiatowicz CS162 UCB Fall 2005 Lec 1 17 What is an Operating System Really Most Likely Memory Management I O Management CPU Scheduling
View Full Document
Unlocking...