os1-1_int

download os1-1_int

of 43

Transcript of os1-1_int

  • 8/13/2019 os1-1_int

    1/43

    A. Frank - P. Weisberg

    Operating Systems

    Introduction to

    Operating System (OS)

  • 8/13/2019 os1-1_int

    2/43

    2 A. Frank - P. Weisberg

    Slides Credits for all PPTs of OS course

    The slides/diagrams in this course are an adaptation,combination, and enhancement of material from thefollowing resources and persons:

    1. Slides of A. Silberschatz, P. B. Galvin and G. Gagne

    (see book references ahead) with someenhancements by Y. Wiseman.

    2. Slides of Mario Marchand of the University ofOttawa and Patricia Roy of Manatee Community

    College based on W. Stallings (see book referenceahead) with some enhancements by O. Kremien andE. Gruengard.

    3. Some diagrams from R. A. Finkel and Andrew S.Tanenbaum (see book references ahead).

  • 8/13/2019 os1-1_int

    3/43

    3 A. Frank - P. Weisberg

    What is an Operating System (1)?

    A modern computer consists of:

    One or more processors

    Main memoryDisks

    Printers

    Various input/output devices.

    Managing all these varied components

    requires a layer of softwarethe

    Operating System (OS).

  • 8/13/2019 os1-1_int

    4/43

    4 A. Frank - P. Weisberg

    What is an Operating System (2)?

    An Operating System is a program that acts as

    an intermediary/interface between a user of a

    computer and the computer hardware.

    OS goals:

    Control/execute user/application programs.

    Make the computer system convenient to use.

    Ease the solving of user problems.

    Use the computer hardware in an efficient manner.

  • 8/13/2019 os1-1_int

    5/43

    5 A. Frank - P. Weisberg

    Where does the OS fit in?

  • 8/13/2019 os1-1_int

    6/43

    6 A. Frank - P. Weisberg

    Services provided by an OS

    Facilities for program creation

    editors, compilers, linkers, debuggers, etc.

    Program execution

    loading in memory, I/O and file initialization.

    Access to I/O and files

    deals with the specifics of I/O and file formats.

    System access

    resolves conflicts for resource contention.

    protection in access to resources and data.

  • 8/13/2019 os1-1_int

    7/437 A. Frank - P. Weisberg

    Why are Operating Systems Important?

    Important to understand and know how to correctlyuse when writing user applications.

    Large and complex systems that have a high

    economic impact and result in interesting problemsof management.

    Few actually involved in OS design andimplementation but nevertheless many general

    techniques to be learned and applied. Combines concepts from many other areas of

    Computer Science: Architecture, Languages,Data Structures, Algorithms.

  • 8/13/2019 os1-1_int

    8/438 A. Frank - P. Weisberg

    Course Syllabus (1)

    Motivation for Operating Systems (OS)

    Introduction

    What's an Operating System?Computer/Operating System Overview

    Evolution of Operating Systems

    Functional/Protection Aspects

    Operating System Structures

  • 8/13/2019 os1-1_int

    9/439 A. Frank - P. Weisberg

    Course Syllabus (2)

    Concurrent Processes

    Process Models and Management

    Process Description and ControlTask/Thread Description and Control

    Concurrency: Mutual Exclusion and

    SynchronizationConcurrency: Deadlock and Starvation

  • 8/13/2019 os1-1_int

    10/4310 A. Frank - P. Weisberg

    Course Syllabus (3)

    Memory Management

    Real Memory Management

    Motivation for Virtual Memory (VM)Paging and Segmentation

    Page Fetch, Placement and Replacement

  • 8/13/2019 os1-1_int

    11/4311 A. Frank - P. Weisberg

    Course Syllabus (4)

    Uniprocessor Scheduling

    Levels of CPU Scheduling

    Process Scheduling External Storage Management

    File Systems/Management

    Directories

    File Allocation

    Disk Scheduling

  • 8/13/2019 os1-1_int

    12/4312 A. Frank - P. Weisberg

    Main Bibliography

    1. A. Silberschatz, P. B. Galvin, and G. Gagne,

    Operating Systems Concepts (with Java),

    8th Edition, John Wiley & Sons, 2009.

    http://codex.cs.yale.edu/avi/os-book/os8/index.php

    http://codex.cs.yale.edu/avi/os-book/os8/index.phphttp://codex.cs.yale.edu/avi/os-book/os8/index.phphttp://codex.cs.yale.edu/avi/os-book/os8/index.phphttp://codex.cs.yale.edu/avi/os-book/os8/index.phphttp://codex.cs.yale.edu/avi/os-book/os8/index.phphttp://codex.cs.yale.edu/avi/os-book/os8/index.php
  • 8/13/2019 os1-1_int

    13/4313 A. Frank - P. Weisberg

    Main Bibliography

    3. W. Stallings,

    Operating Systems:

    Internals and Design

    Principles,

    7thed, Prentice Hall,

    2012.

    http://williamstallings.com/OperatingSyste

    ms/

    http://williamstallings.com/OS/OS5e.htmlhttp://williamstallings.com/OS/OS5e.htmlhttp://williamstallings.com/OS/OS5e.htmlhttp://williamstallings.com/OS/OS5e.htmlhttp://williamstallings.com/OS/OS5e.htmlhttp://williamstallings.com/OS/OS5e.htmlhttp://williamstallings.com/OS/OS5e.html
  • 8/13/2019 os1-1_int

    14/4314 A. Frank - P. Weisberg

    Additional Bibliography

    4. A. S. Tanenbaum,

    Modern Operating

    Systems, 3rd

    Edition, Prentice-

    Hall Intl., 2008.http://www.pearsonhigh

    ered.com/educator/academic/product/0,,013600

    6639,00%2ben-

    USS_01DBC.html

    http://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.htmlhttp://www.pearsonhighered.com/educator/academic/product/0,,0136006639,00%2ben-USS_01DBC.html
  • 8/13/2019 os1-1_int

    15/43

    15 A. Frank - P. Weisberg

    Additional Bibliography

    5. A. S. Tanenbaum and A.

    S. Woodhill, Operating

    Systems: Design and

    Implementation, 3rdEdition, Prentice-Hall

    Intl., 2006.http://www.pearsonhighered.

    com/educator/academic/product/0,,0131429388,00%2ben-

    USS_01DBC.htm

    http://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htmhttp://www.pearsonhighered.com/educator/academic/product/0,,0131429388,00%2ben-USS_01DBC.htm
  • 8/13/2019 os1-1_int

    16/43

    16 A. Frank - P. Weisberg

    Additional Bibliography

    6. S. Toledo, Operating Systems, in Hebrew,Akademon, 2001.

    http://www.tau.ac.il/~stoledo/osbook/

    7. G. Nutt, ``Operating Systems: A ModernPerspective'', 2nd Edition Lab Update,

    Addison-Wesley, 2002.

    http://www.cs.colorado.edu/~nutt/osamp.html8. R. A. Finkel, An Operating Systems Vade

    Mecum, Prentice-Hall Intl., 1988.

    http://www.tau.ac.il/~stoledo/osbook/http://www.cs.colorado.edu/~nutt/osamp.htmlhttp://www.cs.colorado.edu/~nutt/osamp.htmlhttp://www.tau.ac.il/~stoledo/osbook/
  • 8/13/2019 os1-1_int

    17/43

    17 A. Frank - P. Weisberg

    UNIX Bibliography (Internals)

    9. R. Love, Linux Kernel Development, 2nd

    Edition, Novell Press, 2005.

    10. U. Vahalia, UNIX Internals: The NewFrontiers, Prentice-Hall Intl., 1995.

    11. S. J. Leffler, et al, The Design and

    Implementation of the 4.3BSD UNIX

    Operating System, Addison-Wesley, 1989.

    12. M. J. Bach, The Design of the UNIX

    Operating System, Prentice-Hall Intl., 1986.

  • 8/13/2019 os1-1_int

    18/43

    18 A. Frank - P. Weisberg

    UNIX Bibliography (Programming)

    13. K. Haviland, et al, Unix SystemProgramming: A Programmer's Guide toSoftware Development, Addison-Wesley,

    1999.14. W. R. Stevens, and S. A. Rago, Advanced

    Programming in the UNIX Environment, 2nd

    Edition, Addison-Wesley, 2008.15. D. P. Bovet, and M. Cesati, Understanding

    the Linux Kernel, 3rded, OReilly Media,2008

  • 8/13/2019 os1-1_int

    19/43

    19 A. Frank - P. Weisberg

    Computer Hardware Organization

  • 8/13/2019 os1-1_int

    20/43

    20 A. Frank - P. Weisberg

    Computer System Components

    1. Hardwareprovides basic computing resources

    (CPU, Memory, I/O devices, Communication).

    2. Operating Systemcontrols and coordinates the

    use of the hardware among various applicationprograms for various users.

    3. System & Application Programsways in which

    the system resources are used to solve computing

    problems of the users (Word processors, Compilers,

    Web browsers, Database systems, Video games).

    4. Users(People, Machines, other computers).

  • 8/13/2019 os1-1_int

    21/43

    21 A. Frank - P. Weisberg

    Hierarchical view of computer system

  • 8/13/2019 os1-1_int

    22/43

    22 A. Frank - P. Weisberg

    Static View of System Components

  • 8/13/2019 os1-1_int

    23/43

    23 A. Frank - P. Weisberg

    Dynamic View of System Components

  • 8/13/2019 os1-1_int

    24/43

    24 A. Frank - P. Weisberg

    Layers of a Computer System

    End

    User

    Programmer

    Operating-

    System

    Designer

    Computer Hardware

    Operating-System

    Utilities

    ApplicationPrograms

  • 8/13/2019 os1-1_int

    25/43

    25 A. Frank - P. Weisberg

    Views of an Operating System

    There are three classical views (in literature):

    1. Resource Managermanages and allocates

    resources.

    2. Control programcontrols the execution of user

    programs and operations of I/O devices.

    3. Command ExecuterProvides an environment

    for running user commands. But one more modern view: the Operating

    System as a Virtual Machine.

  • 8/13/2019 os1-1_int

    26/43

    26 A. Frank - P. Weisberg

    1. Resource Manager

    Resource Manager:

    Manages and protects multiple computer resources: CPU,

    Processes, Internal/External memory, Tasks, Applications,

    Users, Communication channels, etc Handles and allocates resources to multiple users or

    multiple programs running at the same time and space

    (e.g., processor time, memory, I/O devices).

    Decides between conflicting requests for efficient and fairresource use (e.g., maximize throughput, minimize

    response time).

    Sort of a bottom-up view.

  • 8/13/2019 os1-1_int

    27/43

    27

    OS as a Resource Manager

    A. Frank - P. Weisberg

  • 8/13/2019 os1-1_int

    28/43

    28 A. Frank - P. Weisberg

    Resource Manager oriented OS names

    DEC RSXResource Sharing eXecutive

    MIT MulticsMULTiplexed Information and

    Computing Services

    IBM MFT/MVTMultiple Fixed/Variable Tasks

    IBM MVSMultiple Virtual Storage

    DEC VMSVirtual Memory System

    MVS TSOTime Sharing Option

    CTSSCompatible Time Sharing System

    IBM VMVirtual machine

  • 8/13/2019 os1-1_int

    29/43

    29 A. Frank - P. Weisberg

    2. Control Program

    Control Program:Manages all the components of a complex

    computer system in an integrated manner.

    Controls the execution of user programs andI/O devices to prevent errors and improperuse of computer resources.

    Looks over and protects the computer:

    Monitor, Supervisor, Executive, Controller,Master, Coordinator .

    Sort of a black box view.

  • 8/13/2019 os1-1_int

    30/43

    30 A. Frank - P. Weisberg

    Control program oriented OS names

    Unisys MCPMaster Control Program

    DR CP/MControl Program/Microcomputer

    IBM VM/CPVM Control Program IBM AIXAdvanced Interactive eXecutive

    DEC RSXResource Sharing eXecutive

  • 8/13/2019 os1-1_int

    31/43

    31 A. Frank - P. Weisberg

    3. Command Executer

    Command Executer:

    Interfaces between the users and machine.

    Supplies services/utilities to users.Provides the users with a convenient CLI

    (Command Language Interface), also called

    a Shell (in UNIX), for entering the usercommands.

    Sort of a top-down view.

  • 8/13/2019 os1-1_int

    32/43

    32 A. Frank - P. Weisberg

    Command Executer oriented OS names

    IBM AIXAdvanced Interactive Executive

    IBM VM/CMSConversational monitor

    System

  • 8/13/2019 os1-1_int

    33/43

    33 A. Frank - P. Weisberg

    Modern view: Virtual Machine (1)

    Operating System as a Virtual Machine:

    An interface between the user and hardware that

    hides the details of the hardware (e.g., I/O).

    Constructs higher-level (virtual) resources out oflower-level (physical) resources (e.g., files).

    Definition: OS is a collection of software

    enhancements, executed on the bare hardware,

    culminating in a high-level virtual machine thatserves as an advanced programming environment.

    virtual machine = software enhancement = extended

    machine = abstract machine = layer = level = ring.

  • 8/13/2019 os1-1_int

    34/43

    34 A. Frank - P. Weisberg

    Modern view: Virtual Machine (2)

  • 8/13/2019 os1-1_int

    35/43

    35 A. Frank - P. Weisberg

    Definition of Operating System

    There is no universally accepted definition.

    Everything a vendor ships when you order an

    operating system is good approximation but

    varies widely.

    The one program running at all times on the

    computer is the Kernel.

    Everything else is either a system program

    (ships with the operating system) or an

    application program.

  • 8/13/2019 os1-1_int

    36/43

    36 A. Frank - P. Weisberg

    One Kernel Point of View

  • 8/13/2019 os1-1_int

    37/43

    37 A. Frank - P. Weisberg

    What is the OS/Kernel?

    Is the Operating System just the Kernel (notthe utilities and application programs)?!

    The Command Line Interface (CLI) (or

    command layer/interpreteror shell) allowsdirect command entry by the user.

    The shell used to be in the kernel but now is a

    (first between equals) utility outside of it:Easy to change/debug

    Many of them (sh, bsh, csh, ksh, tcsh, wsh, bash)

    Possible to switch between them (chsh)

  • 8/13/2019 os1-1_int

    38/43

    38 A. Frank - P. Weisberg

    Utilities Shell

    Kernel

    Hardware

    User

    UNIX Shell and Utilities

  • 8/13/2019 os1-1_int

    39/43

    39 A. Frank - P. Weisberg

    Bourne Shell (bsh)

  • 8/13/2019 os1-1_int

    40/43

    40 A. Frank - P. Weisberg

    A very simplified Shell

  • 8/13/2019 os1-1_int

    41/43

  • 8/13/2019 os1-1_int

    42/43

    42 A. Frank - P. Weisberg

    General UNIX Architecture (1)

  • 8/13/2019 os1-1_int

    43/43

    Other application programs

    cc

    Other application programs

    Hardware

    Kernel

    sh whoa.out

    date

    we

    grepedvi

    ldas

    comp

    cppnroff

    General UNIX Architecture (2)