CS 4410/4411 Systems Programming and Operating Systems Fall 2008 Instructor: Hakim WeatherspoonWho am I? • Prof. Hakim Weatherspoon – (Hakim means Doctor, wise, or prof. in Arabic) – Background in Education • Undergraduate University of Washington – Played Varsity Football » Some teammates collectively make $100’s of millions » I teach!!! • Graduate University of California, Berkeley – Some class mates collectively make $100’s of millions – I teach!!! – Background in Operating Systems • Peer-to-Peer Storage – Antiquity project - Secure wide-area distributed system – OceanStore project – Store your data for 1000 years • Network overlays – Bamboo and Tapestry – Find your data around globe • Tiny OS – Early adopter in 1999, but ultimately chose P2P directionGoals for Today • Why take this course on Operating Systems? • What is an Operating System? • History of Operating System design • Oh, and “How does this class operate?” Interactive is important! Ask Questions!Why take this course?Why take this course? • Operating systems are the core of a computer system – OS is magic, unknown, frustrating, and/or scary to most people. – Course will demystify OS!Why take this course? • So that you can help me! Packet LossSending End-hostsCommodity TCPReceiving End-hostsCommodity TCPRouter RouterMaelstrom Receive-Side ApplianceMaelstrom Send-Side ApplianceFECEncode DecodeFunctionality comes with 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?The purpose of an OS: • Two main functions: • Manage physical resources: – It drives various devices • Eg: CPU, memory, disks, networks, displays, cameras, etc – Efficiently, reliably, tolerating and masking failures, etc • Provide an execution environment to the applications running on the computer (programs like Word, Emacs) – Provide virtual resources and interfaces • Eg: files, directories, users, threads, processes, etc – Simplify programming through high-level abstractions – Provide users with a stable environment, mask failuresBut OS designs are Complex • Operating systems are a class of exceptionally complex systems – They are large, parallel, very expensive, not understood • Windows NT/XP: 10 years, 1000s of people, … – Complex systems are the most interesting: • Internet, air traffic control, governments, weather, relationships, etc • How to deal with this complexity? – Abstrations and layering – Our goal: systems that can be trusted with sensitive data and critical rolesWhat is an Operating System? • Magic! • A number of definitions: – Just google for define: Operating System • A few of them: – “Everything a vendor ships when you order an operating system” – “The one program running at all times on the computer” – “A program that manages all other programs in a computer”What is an OS? • A Virtual Machine Abstraction – An operating system implements a virtual machine that is (hopefully) easier and safer to program and use than the raw hardware • What is the hardware interface? – Physical reality • What is the application interface? – Nicer abstraction Application Operating System Hardware Physical Machine Interface Virtual Machine InterfaceWhat is in an OS? Operating System Services Interrupts, Cache, Physical Memory, TLB, Hardware Devices Generic I/O File System Memory Management Process Management Virtual Memory Networking Naming Access Control Windowing & graphics Windowing & Gfx Applications OS Interface Physical m/c Intf Device Drivers Shells System Utils Quake Sql Server Logical OS StructureWhat are the issues in OS Design? • Structure: how is an operating system organized ? • Sharing: how are resources shared among users ? • Naming: how are resources named by users or programs ? • Protection: how is one user/program protected from another ? • Security: how to authenticate, control access, secure privacy ? • Performance: why is it so slow ? • Reliability and fault tolerance: how do we deal with failures ? • Extensibility: how do we add new features ?What are the issues in OS Design? • Communication: how can we exchange information ? • Concurrency: how are parallel activities created and controlled ? • Scale, growth: what happens as demands or resources increase ? • Persistence: how can data outlast processes that created them • Compatibility: can we ever do anything new ? • Distribution: accessing the world of information • Accounting: who pays bills, and how to control resource usageWhy is this material critical? • Concurrency – Therac-25, Ariane 5 rocket (June 96) • Communication – Air Traffic Control System • Virtual Memory – Blue Screens of Death • Security – Credit card dataWhere’s the OS? MelbourneWhere’s the OS? Mesquite, TXHistory of Operating Systems • Initially, the OS was just a run-time library – You linked your application with the OS, – loaded the whole program into memory, and ran it – How do you get it into the computer? Through the control panel! • Simple batch systems (mid1950s – mid 1960s) – Permanently resident OS in primary memory – Loaded a single job from card reader, ran it, loaded next job... – Control cards in the input file told the OS what to do – Spooling allowed jobs to be read in advance onto tape/disk Compute I/OMultiprogramming Systems • Multiprogramming systems increased utilization – Developed in the 1960s – Keeps multiple runnable jobs loaded in memory – Overlaps I/O processing of a job with computation of another – Benefits from I/O
View Full Document