20-JAN-2004

Lecture

Note: You are required to read online notes on your own.
- Anoop Gupta

Introduction

  1. What is Operating System?
    Not easy to define precisely.
    Users

    Applications 
    (compilers, databases, word processors)

    Operating System

    Hardware
    (CPU, Memory, I/O devices)

    • OS is everything in system that isn't an application or hardware
    • OS provides user interface to the system
    • OS is software that converts hardware into useful form (Beautification Principle) for applications by providing:
           - Standard library
           - Resource coordinator (Resource Principle)

    Standard Library
    Advantages:
    - allow applications to reuse common facilities
    - make different devices look the same
    - provide higher-level abstractions

    Challenges:
    - What are the right abstractions

    Resource Coordinator
    Resource - "Something valuable" e.g. CPU, memory (RAM), I/O devices (disk)

    Advantages of Resource Coordinator:
    - Multiple users/applications can share
       -- why share: (1) devices are expensive, and (2) there is need to share data as well as communicate 
    - Protect applications from one another
    - Provide fair and efficient access to resources

    Challenges:
    - OS cannot please all the people all the time, but it should please most of the people most of the time, so:
       What mechanisms? What policies?
       (eg. which user/process should get priority for printing on a common shared printer?)

    Functionalities in OS
    Desired functionalities of OS depend on outside factors like users' & application's "Expectations" and "Technology changes" in Computer Architecture (hardware).

    OS must adapt:
    - Change abstractions provided to users
    - Change algorithms to change these abstractions
    - Change low-level implementation to deal with hardware

    The current operating systems are driven by such evolutions. 

     

  2. Evolution of Operating Systems
    Two distinct phases in history:
    - Phase 1: Expensive computers
    - Phase 2: Cheap computers

    Phase 1
    First commercial systems:
    - Enormous, expensive and slow 
    - I/O: Punch cards and line printers

    Goal - Get the system working

    OS Functionality - Single operator/programmer/user runs and debugs interactively:
    - Standard library with no resource coordination
    - Monitor that is always resident

    Problem - Inefficient use of hardware: poor throughput and poor utilization
    Performance metrics:
    Throughput: like amount of useful work done per hour  
    Utilization: keeping all devices busy

    Batch Processing
    Batch: Group if jobs submitted to machine together
    - Operator collects job, orders efficiently, runs one at a time

    Role of OS
    - Get the system working (same as before)

    Advantages:
    - Amortize setup costs over many jobs
    - Keep machine busy while programmer thinks 

    Disadvantages - User must wait for results until batch collected and submitted 

    Result: Improved system throughput and utilization, but lost interactivity

    Spooling
    Problem
    - Mechanical I/O devices much slower than CPU
    Spooling -
    Overlap I/O with execution by providing pool of ready jobs
    New OS Functionality evolved: Buffering, DMA, interrupt handling
    Advantage: Improves throughput and utilization

    Multiprogrammed Batch Systems
    - Keep multiple jobs resident in memory
    - OS chooses which job to run
    - When job waits for I/O switch to another resident job

    New OS Functionality:
    - Job scheduling policies
    - Memory management and protection

    Advantage
    : Improves throughput and utilization

    Disadvantage:
    Still not interactive

    Phase 2
    Inexpensive fast computers
    Goal: Improve user's response time (make system interactive)

    Time-sharing
    Switch between jobs so frequently that get appearance of dedicated machines for each user/process

    New OS Functionality:
    - More complex job scheduling, memory management
    - Concurrency control and synchronization

    Advantage -
    Users easily submit jobs and get immediate feedbacks

    -- Operating System functionality changes with users and hardware --
    Problems in building OS
    Large Systems - 100k's to millions of lines of code involving 100 to 1000 man-years of work
    Complex: 
    -
    Performance is important while there is conflicting needs of different users
    - Cannot remove all bugs from such complex and large software
    - Behavior is hard to predict; tuning is done by guessing
     
  3. Why Study Operating Systems?
    - Build or modify real operating system
    - Tune application performance
    - Administer and use system well
    - Curiosity: How the system works
    - Apply knowledge in other areas of CS
    - Challenge of designing large and complex systems
    - For your Course Requirement!!


CS 537 - Introduction to Operating Systems (Spring 2004)                                                                                Anoop Gupta