OS Vs Kernel

OS Vs Kernel

Announcements • Prerequisite Forms CS 3204 • My office hours: M/W 3-5pm Operating Systems • Vijay: T/Th 2-4pm Lecture 2 Godmar Back CS 3204 Spring 20061/20/2006 2 Outline for today Why are OS interesting? • Motivation for teaching OS • OS are “magic” – Most people don’t understand them – including • Brief history sysadmins and computer scientists! • A survey of core issues OS address • OS are incredibly complex systems • What you should get out of this class – “Hello, World” – program really 1 million lines of code • Studying OS is learning how to deal with complexity – Abstractions (+interfaces) – Modularity (+structure) – Iteration (+learning from experience) CS 3204 Spring 20061/20/2006 3 CS 3204 Spring 20061/20/2006 4 What does an OS do? OS vs Kernel • Software layer that sits • Can take a wider view or a narrower definition what an OS is between applications • Wide view: Windows, Linux, Mac OSX are operating and hardware systems gcc csh X11 – Includes system programs, system libraries, servers, shells, GUI etc. • Narrow definition: • Performs services Operating System – OS often equated with the kernel. – Abstracts hardware – The Linux kernel; the Windows executive – the special piece of Hardware software that runs with special privileges and actually controls CPU Memory Network Disk – Provides protection the machine. – Manages resources • In this class, usually mean the narrow definition. • In real life, always take the wider view. (Why?) CS 3204 Spring 20061/20/2006 5 CS 3204 Spring 20061/20/2006 6 1 Evolution of OS Evolution of OS (II) • OSs as a library • Invent multiprogramming – Abstracts away hardware, provide neat – First multi-programmed batch systems, then time- interfaces sharing systems • Makes software portable; allows software evolution • Idea: – Single user, single program computers – Load multiple programs in memory • No need for protection: no malicious users, no – Do something else while one program is waiting, don’t interactions between programs sit idle (see next slide) – Disadvantages of uniprogramming model • Complexity increases: • Expensive – What if programs interfer with each other (wild writes) • Poor utilization – What if programs don’t relinguish control (infinite loop) CS 3204 Spring 20061/20/2006 7 CS 3204 Spring 20061/20/2006 8 Single Program vs Protection Multiprogramming • Multiprogramming requires isolation • OS must protect/isolate applications from each other, and OS from applications • This requirement is absolute – In Pintos also: if one application crashes, kernel should not! Bulletproof. • Three techniques –Preemption – Interposition – Privilege CS 3204 Spring 20061/20/2006 9 CS 3204 Spring 20061/20/2006 10 Protection #1: Preemption Protection #2: Interposition • Resource can be given to program and access • OS hides the hardware can be revoked • Application have to go through OS to – Example: CPU, Memory, Printer, “abstract” resources: files, sockets access resources • CPU Preemption using interrupts • OS can interpose checks: – Hardware timer interrupt invokes OS, OS checks if – Validity (Address Translation) current program should be preempted, done every – Permission (Security Policy) 1ms in Linux – Solves infinite loop problem! – Resource Constraints (Quotas) • Q.: Does it work with all resources equally? CS 3204 Spring 20061/20/2006 11 CS 3204 Spring 20061/20/2006 12 2 Protection #3: Privilege OS as a Resource Manager • Two fundamental modes: • OS provides illusions, examples: – “kernel mode” – privileged – every program is run on its own CPU • aka system, supervisor or monitor mode • Intel calls its PL0, Privilege Level 0 on x86 – every program has all the memory of the – “user mode” – non-privileged machine (and more) • PL3 on x86 – every program has its own I/O terminal • Bit in CPU – controls operation of CPU • “Stretches” resources – Protection operations can only be performed in kernel – Possible because resource usage is bursty, mode. Example: hlt typically – Carefully control transitions between user & kernel mode • Increases utilization CS 3204 Spring 20061/20/2006 13 CS 3204 Spring 20061/20/2006 14 Resource Management (2) Resource Management (3) • Multiplexing increases complexity • OS must decide who gets to use what • Car Analogy (by Rosenblum): – Dedicated road per car would be incredibly inefficient, so cars resource share freeway. Must manage this. – (abstraction) different lanes per direction • Approach 1: have admin (boss) tell it – (synchronization) traffic lights • Approach 2: have user tell it – (increase capacity) build more roads • More utilization creates contention – What if user lies? What if user doesn’t know? – (decrease demand) slow down • Approach 3: figure it out through feedback – (backoff/retry) use highway during off-peak hours – (refuse service, quotas) force people into public transportation – Problem: how to tell power users from – (system collapse) traffic jams resource hogs? CS 3204 Spring 20061/20/2006 15 CS 3204 Spring 20061/20/2006 16 Goals for Resource Management • Fairness – Assign resources equitably • Differential Responsiveness – Cater to individual applications’ needs • Efficiency – Maximize throughput, minimize response time, support as many apps as you can • These goals are often conflicting. – All about trade-offs CS 3204 Spring 20061/20/2006 17 3.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    3 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us