Advanced Operating System- Introduction


Published on

Introduction to Advanced Operating systems. Many university courses run advanced/ distributed operating system courses in their 4 year engineering programs. This is based on WBUT CS 704 D course but matches many such courses run by different universities. If you need to downloaad this presentation, please send me an email at

Published in: Education
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Advanced Operating System- Introduction

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