Debasis Das
Syllabus Process synchronization Process Deadlocks Distributed operating System Distributed OS Implementation Multiprocessor Systems Performance, co-processors, RISC & Dataflow Analytic modeling Security & Protection MIT  CS704D Advanced OS  Class of 2011
Recommended Books Operating Systems Concepts & designs – Milan Milenkovic, Tata McGraw Hill Operating System- H M Dietel, Pearson Advanced concepts in Operating Systems – Mukesh Singhal, Niranjan Shivaratri, Tata McGraw Hill MIT  CS704D Advanced OS  Class of 2011
Additional Books Distributed operating Systems Concepts & Design – Pradeep K Sinha Distributed Operating Systems- Andrew S Tanenbaum, Tata McGraw Hill Modern Operating Systems – Andrew S Tanenbaum, Pearson Operating System principles=Abraham Silberschanz, Peter B Galvin, Greg Gagne, Wiley Asia MIT  CS704D Advanced OS  Class of 2011
MIT  CS704D Advanced OS  Class of 2011
Evolution of OS Serial processing: Take one job, complete the execution, print out results, take the next job Batch processing: Take a batch of jobs, process them Multiprogramming: Manage program execution as programs come in. Multiple ones may be in execution. MIT  CS704D Advanced OS  Class of 2011
MIT  CS704D Advanced OS  Class of 2011 Program Execution Program Development Edit Compile Execute
Serial processing Theoretically at least, I can program everything to process a program from start to finish Use of input/ Output devices : punched cards, paper tapes (late fifties) Add I/O routine Loader, linker, librarian formed the rudimentary OS MIT  CS704D Advanced OS  Class of 2011
Batch processing Automate sequencing Some housekeeping, like mounting of tapes required to be done manually. Batch several programs on a single tape, housekeeping required only once Phasing = place similar programs in one batch Load Fortran compiler only once for a batch of Fortran programs Need for a Job Control language (JCL) MIT  CS704D Advanced OS  Class of 2011
JCL Job beginning and end markers Loading of program Compiling and execution of the program Commands to define resource requirements such as execution time, memory requirements A batch monitor (memory resident part of the batch operating system) would read, interpret and execute these commands MIT  CS704D Advanced OS  Class of 2011
Improvements Through the Batch OS Increased system resources utilization, throughput by reducing the idle time between programs Program development is not helped much Turn around times were long Debug was offline and difficult to do from memory dump MIT  CS704D Advanced OS  Class of 2011
Further Changes  Program execution becoming quite fast, slow I/O times started becoming noticeable Overlapping of I/O with batch operations were the need of the hour DMA channels, peripheral controllers and even dedicate I/O controllers started appearing SPOOL, read/write to disk files MIT  CS704D Advanced OS  Class of 2011
MIT  CS704D Advanced OS  Class of 2011 Typical program Compute I/O Compute I/O Possible speed up Compute I/O Compute I/O Compute I/O Compute I/O Degree of multiprogramming= number of programs competing for resources Higher the degree of multiprogramming, higher the resource utilization
Example of Multiprogramming Time shared systems ; program, data  stored on secondary storage Users provide the job control commands interactively; compile, run and so on Debug is easier with a separate debug system in the OS Program development is helped by interactive edit, compile, debug etc. MIT  CS704D Advanced OS  Class of 2011
MIT  CS704D Advanced OS  Class of 2011
Types of Operating Systems Studied Batch OS Multiprogramming OS Time sharing systems Real time systems A combination OS MIT  CS704D Advanced OS  Class of 2011
Aspects of Operating Systems Compared Processor scheduling Memory management I/O management File management MIT  CS704D Advanced OS  Class of 2011
Batch Operating System Program, data, system commands submitted together Very little interaction with users, practically none Better resource utilization Long turn around Difficult debug Programs with long execution times are well suited; e.g payroll, forecasting, statistical analysis etc. Scheduling is first come first served Memory management is simple No time critical I/O management required Rudimentary file system may be present MIT  CS704D Advanced OS  Class of 2011
Multiprogramming operating Systems System throughput and resource utilization can be improved Supports two or more active processes, code and data of which needs to be in memory Hardware and/or software memory protection required Supports multiple users, user authentication, per user accounting of resource usage needed Multi access system Multi processor system MIT  CS704D Advanced OS  Class of 2011
Time-Sharing Systems Multi programming, multi user system Program development environment, Computer aided design, text processing systems Good terminal response time required Time sliced, round robin scheduling Memory management must provide protection. Data sharing also may be needed I/O management must preserve system integrity & good performance MIT  CS704D Advanced OS  Class of 2011
Real-time Systems Events external to the computer must be processed Quick even-response required Industrial control, flight control, telephone switching May be necessary to process thousands of interrupts w/o missing one User convenience and resource utilization is on secondary significance Priority based scheduling of unique processes connected to the event It is also preemptive All processes are memory resident, processes do not die, low movements of programs between main and secondary memories Time critical device management is critical, I/O management, interrupt management MIT  CS704D Advanced OS  Class of 2011
Combination Operating Systems Real life is a mix of situations. A university system may need to provide  program development needs as well as  long simulations Combination of features are thus common A multi user interactive system OS may support batch operation Time shared terminal servers may need to send and accept real time packets  MIT  CS704D Advanced OS  Class of 2011
Distributed Operating System Independent systems that communicate and collaborate via hardware and software features OS  coordinates the interaction and presents a virtual machine  feel to users System wide sharing of resources characterizes such OS, remote resources may be shared, computation may be sent to a remote node Global naming, distributed file systems, distribution of computations are required features MIT  CS704D Advanced OS  Class of 2011
MIT  CS704D Advanced OS  Class of 2011
Types of Users Users who get services from the OS through commands typed at a terminal, or embedded ones in a batch job (Command language users) Users who obtain services through system calls at the run time. Calls that are activated when the program runs through them (System call users) MIT  CS704D Advanced OS  Class of 2011
Command Language User’s View  System specific Functionality is similar though, syntax varies Typical such functions are log on & house keeping, Program activation and control, file management, status reporting and system management MIT  CS704D Advanced OS  Class of 2011
Log On & Housekeeping Typically on multiuser systems Log on and off Password management Setting of some initial configuration; type of terminal, naming of file system devices MIT  CS704D Advanced OS  Class of 2011
Program Activation & Control Loading of program, run or abort Quite often just typing the name of the program will run (load and execute) it Scheduling may be available Setting of scheduling priorities also may be available MIT  CS704D Advanced OS  Class of 2011
File Management Create, delete, rename, copy files File utilities are available ( comparison etc) Volume maintenance feat5ures MIT  CS704D Advanced OS  Class of 2011
Status Reporting Status of user initiated activities, devices assigned and system wide state Status, size and content of print queue etc could be requested by the user Performance stats may be made available These routines that monitor performance are resource hogs, so they may be accessible to a privileged class of users only MIT  CS704D Advanced OS  Class of 2011
System management For system managers and maintenance personnel Creation and maintenance of user accounts, resource usage limits, specifying default devices Collecting reports on system performance, behavior Analysis of error and debug MIT  CS704D Advanced OS  Class of 2011
System call User’s View System calls through the API (Application programming interface) Provides all the services available through command (except log on/off), finer and more controls  More direct control to I/O hardware Program control (run, execute, abort, suspend, resume etc.) Inter program communication and synchronization Resource management ( memory allocation, release, etc.) Device & file management (open & close a device, random access to block structured devices, init and mode selection, etc.) MIT  CS704D Advanced OS  Class of 2011
Typical Command Flow #1 Typical command Edit Myfile.txt On CR the low level keyboard driver passes the command to the CLI CLI parses the command and searches for Edit If not in main memory starts a search on disk drive through a disk driver, directory entry tells OS memory requirement Memory managers allocates memory, loads into that space Address maps are updated MIT  CS704D Advanced OS  Class of 2011
Typical Command Flow #2 A unique process is created with a PCB Program name, system id, execution priority, pointers to address translation tables, list of allocated resources, etc. Placed into system ready list Scheduler the decides when to start processing the Editor process When started editor issues system calls for opening the files etc. Passes message to user if not found Editor asks if a new file should be created, communicates through standard input and output MIT  CS704D Advanced OS  Class of 2011
Typical Command Flow #3 Create “Myfile.txt” through a system call Interacts with user based on edit commands and stores inputs into the file On termination, editor writes pending data in buffers Closes file through system call, issues system call for exit OS check PCB for any open files, closes and terminates the process. Memory and resources are freed, PCB memory freed into the PCB pool MIT  CS704D Advanced OS  Class of 2011
MIT  CS704D Advanced OS  Class of 2011
Problems & Approaches in  Design & Implementation What are the needs of managing OS objects? (processes, memory, files) The structural view for implementation MIT  CS704D Advanced OS  Class of 2011
Functional Requirements#1 Management of processes Created based on user request, implicit or explicit Requires system services, resources Multiple processes can compete for processing resources Exception handling Allocate hardware/software resources, pro6ection, access control, security Inter-process communications, signals and message MIT  CS704D Advanced OS  Class of 2011
Functional Requirements#2 Management of memory Specific requirements of processes Dynamic expansion of needs Contiguous or non contiguous allocation of memory Fragmentation , mapping issues (segmentation, paging, virtual memory Isolation of processes for violating other spaces, controlled sharing MIT  CS704D Advanced OS  Class of 2011
Functional Requirements#3 File system needs Device independent access Protection & sharing Recovery & restoration Distributed systems Global naming Distributed file system Inter-process communication & synchronization MIT  CS704D Advanced OS  Class of 2011
MIT  CS704D Advanced OS  Class of 2011 Kernel Basic I/O Memory management File system Command language interpreter
Implementation #2 MIT  CS704D Advanced OS  Class of 2011 Level Name Objects Typical  Operations 5 CLI Environment data Statements in command language 4 File system Files, devices Create, delete, open, close, read, write 3 Memory management Segments, pages Read, write, fetch 2 Basic I/O Data blocks Read, write, allocate, free 1 kernel Process, semaphores Create, destroy, suspend, resume, signal, wait
Implementation #3 Goals Reliability Ease of maintenance Necessary Modularity Hiding complexity Clean interface between layers MIT  CS704D Advanced OS  Class of 2011

Advanced Operating System- Introduction

  • 1.
  • 2.
    Syllabus Process synchronizationProcess Deadlocks Distributed operating System Distributed OS Implementation Multiprocessor Systems Performance, co-processors, RISC & Dataflow Analytic modeling Security & Protection MIT CS704D Advanced OS Class of 2011
  • 3.
    Recommended Books OperatingSystems Concepts & designs – Milan Milenkovic, Tata McGraw Hill Operating System- H M Dietel, Pearson Advanced concepts in Operating Systems – Mukesh Singhal, Niranjan Shivaratri, Tata McGraw Hill MIT CS704D Advanced OS Class of 2011
  • 4.
    Additional Books Distributedoperating Systems Concepts & Design – Pradeep K Sinha Distributed Operating Systems- Andrew S Tanenbaum, Tata McGraw Hill Modern Operating Systems – Andrew S Tanenbaum, Pearson Operating System principles=Abraham Silberschanz, Peter B Galvin, Greg Gagne, Wiley Asia MIT CS704D Advanced OS Class of 2011
  • 5.
    MIT CS704DAdvanced OS Class of 2011
  • 6.
    Evolution of OSSerial processing: Take one job, complete the execution, print out results, take the next job Batch processing: Take a batch of jobs, process them Multiprogramming: Manage program execution as programs come in. Multiple ones may be in execution. MIT CS704D Advanced OS Class of 2011
  • 7.
    MIT CS704DAdvanced OS Class of 2011 Program Execution Program Development Edit Compile Execute
  • 8.
    Serial processing Theoreticallyat least, I can program everything to process a program from start to finish Use of input/ Output devices : punched cards, paper tapes (late fifties) Add I/O routine Loader, linker, librarian formed the rudimentary OS MIT CS704D Advanced OS Class of 2011
  • 9.
    Batch processing Automatesequencing Some housekeeping, like mounting of tapes required to be done manually. Batch several programs on a single tape, housekeeping required only once Phasing = place similar programs in one batch Load Fortran compiler only once for a batch of Fortran programs Need for a Job Control language (JCL) MIT CS704D Advanced OS Class of 2011
  • 10.
    JCL Job beginningand end markers Loading of program Compiling and execution of the program Commands to define resource requirements such as execution time, memory requirements A batch monitor (memory resident part of the batch operating system) would read, interpret and execute these commands MIT CS704D Advanced OS Class of 2011
  • 11.
    Improvements Through theBatch OS Increased system resources utilization, throughput by reducing the idle time between programs Program development is not helped much Turn around times were long Debug was offline and difficult to do from memory dump MIT CS704D Advanced OS Class of 2011
  • 12.
    Further Changes Program execution becoming quite fast, slow I/O times started becoming noticeable Overlapping of I/O with batch operations were the need of the hour DMA channels, peripheral controllers and even dedicate I/O controllers started appearing SPOOL, read/write to disk files MIT CS704D Advanced OS Class of 2011
  • 13.
    MIT CS704DAdvanced OS Class of 2011 Typical program Compute I/O Compute I/O Possible speed up Compute I/O Compute I/O Compute I/O Compute I/O Degree of multiprogramming= number of programs competing for resources Higher the degree of multiprogramming, higher the resource utilization
  • 14.
    Example of MultiprogrammingTime shared systems ; program, data stored on secondary storage Users provide the job control commands interactively; compile, run and so on Debug is easier with a separate debug system in the OS Program development is helped by interactive edit, compile, debug etc. MIT CS704D Advanced OS Class of 2011
  • 15.
    MIT CS704DAdvanced OS Class of 2011
  • 16.
    Types of OperatingSystems Studied Batch OS Multiprogramming OS Time sharing systems Real time systems A combination OS MIT CS704D Advanced OS Class of 2011
  • 17.
    Aspects of OperatingSystems Compared Processor scheduling Memory management I/O management File management MIT CS704D Advanced OS Class of 2011
  • 18.
    Batch Operating SystemProgram, data, system commands submitted together Very little interaction with users, practically none Better resource utilization Long turn around Difficult debug Programs with long execution times are well suited; e.g payroll, forecasting, statistical analysis etc. Scheduling is first come first served Memory management is simple No time critical I/O management required Rudimentary file system may be present MIT CS704D Advanced OS Class of 2011
  • 19.
    Multiprogramming operating SystemsSystem throughput and resource utilization can be improved Supports two or more active processes, code and data of which needs to be in memory Hardware and/or software memory protection required Supports multiple users, user authentication, per user accounting of resource usage needed Multi access system Multi processor system MIT CS704D Advanced OS Class of 2011
  • 20.
    Time-Sharing Systems Multiprogramming, multi user system Program development environment, Computer aided design, text processing systems Good terminal response time required Time sliced, round robin scheduling Memory management must provide protection. Data sharing also may be needed I/O management must preserve system integrity & good performance MIT CS704D Advanced OS Class of 2011
  • 21.
    Real-time Systems Eventsexternal to the computer must be processed Quick even-response required Industrial control, flight control, telephone switching May be necessary to process thousands of interrupts w/o missing one User convenience and resource utilization is on secondary significance Priority based scheduling of unique processes connected to the event It is also preemptive All processes are memory resident, processes do not die, low movements of programs between main and secondary memories Time critical device management is critical, I/O management, interrupt management MIT CS704D Advanced OS Class of 2011
  • 22.
    Combination Operating SystemsReal life is a mix of situations. A university system may need to provide program development needs as well as long simulations Combination of features are thus common A multi user interactive system OS may support batch operation Time shared terminal servers may need to send and accept real time packets MIT CS704D Advanced OS Class of 2011
  • 23.
    Distributed Operating SystemIndependent systems that communicate and collaborate via hardware and software features OS coordinates the interaction and presents a virtual machine feel to users System wide sharing of resources characterizes such OS, remote resources may be shared, computation may be sent to a remote node Global naming, distributed file systems, distribution of computations are required features MIT CS704D Advanced OS Class of 2011
  • 24.
    MIT CS704DAdvanced OS Class of 2011
  • 25.
    Types of UsersUsers who get services from the OS through commands typed at a terminal, or embedded ones in a batch job (Command language users) Users who obtain services through system calls at the run time. Calls that are activated when the program runs through them (System call users) MIT CS704D Advanced OS Class of 2011
  • 26.
    Command Language User’sView System specific Functionality is similar though, syntax varies Typical such functions are log on & house keeping, Program activation and control, file management, status reporting and system management MIT CS704D Advanced OS Class of 2011
  • 27.
    Log On &Housekeeping Typically on multiuser systems Log on and off Password management Setting of some initial configuration; type of terminal, naming of file system devices MIT CS704D Advanced OS Class of 2011
  • 28.
    Program Activation &Control Loading of program, run or abort Quite often just typing the name of the program will run (load and execute) it Scheduling may be available Setting of scheduling priorities also may be available MIT CS704D Advanced OS Class of 2011
  • 29.
    File Management Create,delete, rename, copy files File utilities are available ( comparison etc) Volume maintenance feat5ures MIT CS704D Advanced OS Class of 2011
  • 30.
    Status Reporting Statusof user initiated activities, devices assigned and system wide state Status, size and content of print queue etc could be requested by the user Performance stats may be made available These routines that monitor performance are resource hogs, so they may be accessible to a privileged class of users only MIT CS704D Advanced OS Class of 2011
  • 31.
    System management Forsystem managers and maintenance personnel Creation and maintenance of user accounts, resource usage limits, specifying default devices Collecting reports on system performance, behavior Analysis of error and debug MIT CS704D Advanced OS Class of 2011
  • 32.
    System call User’sView System calls through the API (Application programming interface) Provides all the services available through command (except log on/off), finer and more controls More direct control to I/O hardware Program control (run, execute, abort, suspend, resume etc.) Inter program communication and synchronization Resource management ( memory allocation, release, etc.) Device & file management (open & close a device, random access to block structured devices, init and mode selection, etc.) MIT CS704D Advanced OS Class of 2011
  • 33.
    Typical Command Flow#1 Typical command Edit Myfile.txt On CR the low level keyboard driver passes the command to the CLI CLI parses the command and searches for Edit If not in main memory starts a search on disk drive through a disk driver, directory entry tells OS memory requirement Memory managers allocates memory, loads into that space Address maps are updated MIT CS704D Advanced OS Class of 2011
  • 34.
    Typical Command Flow#2 A unique process is created with a PCB Program name, system id, execution priority, pointers to address translation tables, list of allocated resources, etc. Placed into system ready list Scheduler the decides when to start processing the Editor process When started editor issues system calls for opening the files etc. Passes message to user if not found Editor asks if a new file should be created, communicates through standard input and output MIT CS704D Advanced OS Class of 2011
  • 35.
    Typical Command Flow#3 Create “Myfile.txt” through a system call Interacts with user based on edit commands and stores inputs into the file On termination, editor writes pending data in buffers Closes file through system call, issues system call for exit OS check PCB for any open files, closes and terminates the process. Memory and resources are freed, PCB memory freed into the PCB pool MIT CS704D Advanced OS Class of 2011
  • 36.
    MIT CS704DAdvanced OS Class of 2011
  • 37.
    Problems & Approachesin Design & Implementation What are the needs of managing OS objects? (processes, memory, files) The structural view for implementation MIT CS704D Advanced OS Class of 2011
  • 38.
    Functional Requirements#1 Managementof processes Created based on user request, implicit or explicit Requires system services, resources Multiple processes can compete for processing resources Exception handling Allocate hardware/software resources, pro6ection, access control, security Inter-process communications, signals and message MIT CS704D Advanced OS Class of 2011
  • 39.
    Functional Requirements#2 Managementof memory Specific requirements of processes Dynamic expansion of needs Contiguous or non contiguous allocation of memory Fragmentation , mapping issues (segmentation, paging, virtual memory Isolation of processes for violating other spaces, controlled sharing MIT CS704D Advanced OS Class of 2011
  • 40.
    Functional Requirements#3 Filesystem needs Device independent access Protection & sharing Recovery & restoration Distributed systems Global naming Distributed file system Inter-process communication & synchronization MIT CS704D Advanced OS Class of 2011
  • 41.
    MIT CS704DAdvanced OS Class of 2011 Kernel Basic I/O Memory management File system Command language interpreter
  • 42.
    Implementation #2 MIT CS704D Advanced OS Class of 2011 Level Name Objects Typical Operations 5 CLI Environment data Statements in command language 4 File system Files, devices Create, delete, open, close, read, write 3 Memory management Segments, pages Read, write, fetch 2 Basic I/O Data blocks Read, write, allocate, free 1 kernel Process, semaphores Create, destroy, suspend, resume, signal, wait
  • 43.
    Implementation #3 GoalsReliability Ease of maintenance Necessary Modularity Hiding complexity Clean interface between layers MIT CS704D Advanced OS Class of 2011