Slide 1Introduction to Operating SystemsWhat is an Operating System?Slide 4Operating System FunctionsWhy do we need operating systems?Computer Architecture & ProcessesEvolution of Operating SystemsFrom Architecture to OS to Application, and BackFrom Architectural to OS to Application, and BackInterrupts - Moving from Kernel to User ModeHistory of Operating Systems: PhasesSlide 13A Brief History of Operating Systems Hand programmed machines (‘45-‘55)Batch/Off-line processing (‘55-‘65)Batch processing (‘55-‘65)Multiprogramming (‘65-‘80)Slide 18Slide 19Slide 20Timesharing (‘70- )Slide 22Operating Systems for PCsDistributed Operating SystemsSlide 25What is cloud computing?Slide 27Richer Operating Systems Intellectual propertyRicher Operating Systems Information organizationCourse Overview1Operating Systems:Basic Concepts and History2Introduction to Operating SystemsAn operating system is the interface between the user and the architecture.OS as juggler: providing the illusion of a dedicated machine with infinite memory and CPU.OS as government: protecting users from each other, allocating resources efficiently and fairly, and providing secure and safe communicationOS as complex system: keeping OS design and implementation as simple as possible is the key to getting the OS to workUser ApplicationsOperating SystemHardwareVirtual Machine InterfacePhysical Machine Interface3What is an Operating System?Any code that runs with the hardware kernel bit setAn abstract virtual machineA set of abstractions that simplify application designFiles instead of “bytes on a disk”Core OS services, written by “pros”Processes, process schedulingAddress spacesDevice control~30% of Linux source code. Basis of stability and securityDevice drivers written by “whoever”Software run in kernel to manages a particular vendor’s hardwareE.g. Homer Simpson doll with USB ~70% of Linux source codeOS is extensibleDrivers are the biggest source of OS instability4What is an Operating System?For any OS area (CPU scheduling, file systems, memory management), begin by asking two questionsWhat’s the hardware interface? (The Physical Reality)What is the application interface? (The Nicer Interface for programmer producivity)Key questions:Why is the application interface defined the way it is?Should we push more functionality into applications, the OS, or the hardware?What are the tradeoffs between programmability, complexity, and flexibility?5Operating System FunctionsService providerProvide standard facilities File systemStandard librariesWindow system…Coordinator: three aspectsProtection: prevent jobs from interfering with each otherCommunication: enable jobs to interact with each otherResource management: facilitate sharing of resources across jobs.Operating systems are everywhereSingle-function devices (embedded controllers, Nintendo, …)OS provides a collection of standard servicesSometimes OS/middleware distinction is blurryMulti-function/application devices (workstations and servers)OS manages application interactions6Why do we need operating systems?ConvenienceProvide a high-level abstraction of physical resources.Make hardware usable by getting rid of warts & specifics.Enable the construction of more complex software systemsEnable portable code.MS-DOS version 1 boots on the latest Intel Core.Would games that ran on MS-DOSv1 work well today?EfficiencyShare limited or expensive physical resources.Provide protection.7Computer Architecture & ProcessesCPU - the processor that performs the actual computation I/O devices - terminal, disks, video board, printer, etc. Memory - RAM containing data and programs used by the CPU System bus - the communication medium between the CPU, memory, and peripherals8Evolution of Operating SystemsWhy do operating systems change?Key functions: hardware abstraction and coordinationPrinciple: Design tradeoffs change as technology changes.Comparing computing systems from 1981 and 20071981 2007 FactorMIPS 1 57,000 57,000$/SPECInt $100K $2 50,000DRAM size 128KB 2GB 16,000Disk size 10MB 1TB 100,000Net BW 9600 bps 100 Mb/s 10,000Address bits 16 64 4Users/machine 100 <1 100Energy efficiency and parallelism loom on the horizon.Data centers consume ~3% of US energyNo more single-core CPUs9From Architecture to OS to Application, and BackHardware Example OS Services User AbstractionProcessor Process management, Scheduling, Traps, Protections, Billing, SynchronizationProcessMemory Management, Protection, Virtual memoryAddress spaceI/O devices Concurrency with CPU, Interrupt handlingTerminal, Mouse, Printer, (System Calls)File system Management, Persistence FilesDistributed systemsNetwork security, Distributed file systemRPC system calls, Transparent file sharing10From Architectural to OS to Application, and BackOS Service Hardware SupportProtection Kernel / User modeProtected InstructionsBase and Limit RegistersInterrupts Interrupt VectorsSystem calls Trap instructions and trap vectorsI/O Interrupts or Memory-MappingScheduling, error recovery, billingTimerSynchronization Atomic instructionsVirtual Memory Translation look-aside buffersRegister pointing to base of page table11Interrupts - Moving from Kernel to User ModeUser processes may not:address I/O directlyuse instructions that manipulate OS memory (e.g., page tables)set the mode bits that determine user or kernel modedisable and enable interruptshalt the machinebut in kernel mode, the OS does all these thingsa status bit in a protected processor register indicates the modeProtected instructions can only be executed in kernel mode.On interrupts (e.g., time slice) or system calls12History of Operating Systems: PhasesPhase 1: Hardware is expensive, humans are cheapUser at console: single-user systemsBatching systemsMulti-programming systemsPhase 2: Hardware is cheap, humans are expensiveTime sharing: Users use cheap terminals and share serversPhase 3: Hardware is very cheap, humans are very expensivePersonal computing: One system per userDistributed computing: lots of systems per userPhase 4: Ubiquitous computing/Cloud computingCell phone, mp3 player, DVD player, TIVO, PDA, iPhone, eReaderSoftware as a service, Amazon’s elastic compute cloud13History of Operating Systems: PhasesPhase 1: Hardware is expensive, humans are cheapUser at console:
View Full Document