Post on 10-Apr-2018
8/8/2019 AOS01 Intro
1/29
Advanced Operating System
By: Dr. M. Alam
Introduction
Advanced OS : Dr. M. Alam
Grading
? Attendance? 75% required
? Absence is marked after 10 minutes
? Assignments
? Late submission means 5% deduction per week
? Mid-term Exam.
? Presentation / Research Report
? Final Exam.
8/8/2019 AOS01 Intro
2/29
Advanced OS : Dr. M. Alam
1. Modern Operating Systems, Andrew S.Tanenbaum.
2. Distributed Systems, Andrew S. Tanenbaum.3. Operating Systems by William Stallings, 3rd
Edition.
4. Operating System Concepts, SilberschatzGalvin, 7th Edition
5. Distributed Systems : Concepts and Design,G. Coulouris, J. Dollimore & T. Kindberg
6. Internet websites .
Recommended Books
Advanced OS : Dr. M. Alam
Course Outline
? Introduction? Communication
? Synchronization
? Processes & Scheduling
? File System
? Specific OS
? Research Work
8/8/2019 AOS01 Intro
3/29
Advanced OS : Dr. M. Alam
? Introduction of Operating System
? Computer Systems and Operating System
? Introduction ofAdvanced Systems
? Introduction of Distributed Operating System
? Exposure of existing operating systems : Unix,
Linux, Window NT,
? Discussion and implementation issues
Objectives
Advanced OS : Dr. M. Alam
What is Operating System ?
? A program that acts as an intermediary between a
user of a computer and the computer hardware
? Provides facilities how to use the computer
? Layer of software on the top of bare H/W that
control & manage the resources
? Examples : UNIX, IRIX, LINUX, Windows, .
? Runs in kernel or supervisor mode / protected
from user
8/8/2019 AOS01 Intro
4/29
Advanced OS : Dr. M. Alam
How it works?
Example
Process Swapping in Time Sharing SystemsProcess Swapping in Time Sharing Systems
? System Calls
? Start process, Terminate process, Release memory,
? Process Table Entry
Application
Program
Extended Instructions
System Calls
Operating
System
Advanced OS : Dr. M. Alam
Computer System
? Computer System Components?Hardware provides basic computing resources like
CPU, memory, I/O devices.
? OS controls & coordinates the use of hardware
among the various application programs for the
various users.
?Application programs define the ways in which the
system resources are used to solve the computing
problems of the users (Database systems, Video
games, Business programs).
? Users (People, Machines, Other computers)
8/8/2019 AOS01 Intro
5/29
Advanced OS : Dr. M. Alam
Computer System
User
Hardware
OS/KERNEL
System
Programs
Application/Shell? Functionality of OS
? Initializes H/W
? Provides device control
? Provides management, scheduling
& interaction of tasks
? Maintain system integrity
? Error handling
? Converts users commands to
machine language
Advanced OS : Dr. M. Alam
Parts of OS
Generally a modern OS has four parts:
Operating System
SchedulerProcess
Manager
Kernel File
Manager
8/8/2019 AOS01 Intro
6/29
Advanced OS : Dr. M. Alam
User View of OS
? Standalone PC
? The operating system is designed for ease of use
? Little attention paid to performance
? None paid to resource utilization
? Mainframe or Minicomputer
? Operating system is designed to maximize resource utilization
? Users share resources like CPU, memory and I/O efficiently
? Workstations
? Users connected through network, have dedicated resources at
their disposal but shared as well
? The OS is designed to compromise between individual usability
and resource utilization
Advanced OS : Dr. M. Alam
System View of OS
?
Resource Allocation? Computer System Resources- CPU, Clock, Memory,
Disks, Terminals, I/O devices,
? OS acts as a manager of these resources
? Manages & allocates resources to specific users andprograms so that it can operate efficiently and fairly
? Control Program
? Controls the execution of user programs and operationsof I/O devices.
?
Kernel? The one program running at all times
8/8/2019 AOS01 Intro
7/29
Advanced OS : Dr. M. Alam
Tasks of OS
? Process Control
? Memory Management
? File Systems & Management
? I/O Control
? Security
? Synchronization
? Communication
Advanced OS : Dr. M. Alam
Computer Systems & OS
8/8/2019 AOS01 Intro
8/29
Advanced OS : Dr. M. Alam
Computer Systems
?Mainframe Systems
?Desktop Systems
?Multiprocessor Systems
?Clustered Systems
?Distributed Systems
?Real-Time Systems
?Handheld Systems
Advanced OS : Dr. M. Alam
Mainframe Systems
? First computers used to tackle manycommercial and scientific applications
? Types of mainframe systems:
? Simple Batch Systems
? Multiprogramming Batch Systems
? Time-Sharing Systems
8/8/2019 AOS01 Intro
9/29
Advanced OS : Dr. M. Alam
Simple Batch Systems
? Input /Output Devices: Card Readers, TapeDrives, Line printers, Card Punches (Slower mechanical devices)
? Programmer/user prepare a job (program,data and control information)
? CPU often sits idle
? Similar jobs are batched together to speed upprocessing
? OS:
? Transfer control automatically betweenjobs
? Could perform job scheduling (due todirect access to several jobs on a disk )
? Always resident in memory
Memory Layout
Advanced OS : Dr. M. Alam
Multiprogramming Batch Systems
Several jobs are kept in mainmemory at the same time andCPU is multiplexed
Operating System
Job 1
Job 2
Job 3
0
512K
OS Features
? I/O routines supplied by the system.
? Memory management the system must
allocate the memory to several jobs.
? CPU scheduling the system must
choose among several jobs ready to run.? Allocation of devices.
8/8/2019 AOS01 Intro
10/29
Advanced OS : Dr. M. Alam
Time-Sharing Systems
? The CPU is multiplexed among several jobs (CPUis allocated to a job only if the job is in memory).
? A job swapped in and out of memory to the disk.
? On-line communication between the user and thesystem is provided; when OS finishes theexecution of one command, it seeks the nextcontrol statement from the users keyboard.
? These systems involves memory management andprotection, file system, CPU scheduling, Jobsynchronization and communication, and avoiding
jobs to be deadlocked.
Advanced OS : Dr. M. Alam
Desktop Systems
?Personal Computers System dedicated to asingle user.
? I/O devices Keyboards, Display screens,
Small Printers, ..
? User convenience and responsiveness.
? Do not need advanced CPU utilization or
protection features.
?
May run several different types of operatingsystems (Windows, MAC OS, UNIX, Linux)
8/8/2019 AOS01 Intro
11/29
Advanced OS : Dr. M. Alam
Multiprocessor / Parallel Systems
? Systems with more than one CPU in closecommunication.
? Tightly coupled system:
? Processors share memory and a clock
? communication usually takes place through theshared memory
? Advantages of parallel system:
? Increased Throughput
?Economical
? Increased Reliability
Advanced OS : Dr. M. Alam
Fault Tolerant Mechanism
? System consists of two identical processors(primary and backup), each with its local memory.
? Processors are connected through a bus.
? During the execution of the system, the state
information of each job (including a copy of
memory image) is copied from primary to backup.
? In case of failure, backup copy is activated and
restart from the most recent checkpoint.
? An expensive solution as it involves considerablehardware duplication.
8/8/2019 AOS01 Intro
12/29
Advanced OS : Dr. M. Alam
Multiprocessing
? Symmetric Multiprocessing (SMP)
? Each processor runs an identical copy of the OS.
? Many processes can run at once without performance
deterioration.
? Most modern operating systems support SMP.
? Asymmetric Multiprocessing
? Each processor performs a specific task; master
processor schedules and allocate work to slave.
? More common in extremely large systems.
? The difference between SMP and Asymmetric MP
could be either hardware or software.
Advanced OS : Dr. M. Alam
Distributed Systems
?
Distribute the computation among severalphysical processors.
?Loosely coupled system
? Each processor has its own local memory
? Processors communicate with each other through high-speed buses or switches or telephone lines.
? Requires networking infrastructure
? Local area networks (LAN) or
? Wide area networks (WAN)
? May be either client-server or peer-to-peersystems.
8/8/2019 AOS01 Intro
13/29
Advanced OS : Dr. M. Alam
Distributed Systems (Conti.)
? Advantages of distributed systems: Resource Sharing,
Computation Speedup, Load Sharing, Reliability,
? NetworkOS
? Provides file sharing? Provides communication schemes that allows different
processes on different computers to exchange messages.
? Runs independently from the other computers on the network.
? Distributed OS
? Less autonomy between computers
? Give the impression there is a single OS controlling the
network.
Advanced OS : Dr. M. Alam
Clustered Systems
?
Combination of two or more systems (nodes)connected through S/W and network infrastructure
? Shared resources
? Processors communicate using message passing
? Cheaper with respect to high processing power
? Homogeneous Cluster
? All nodes have similar architecture and similar OS
? Heterogeneous Cluster
? Nodes have different architecture or different OS
?
No specific OS; OS is installed on all machines? Unavailability of general-purpose distributed file
system
8/8/2019 AOS01 Intro
14/29
Advanced OS : Dr. M. Alam
Real Time Systems
? Often used as a control device in a dedicatedapplication such as
? Controlling scientific experiments
? Medical imaging systems
? Industrial control systems
? Some display systems,
? Well-defined fixed-time constraints.
? Real-Time systems may be either
? hard or
? soft
Advanced OS : Dr. M. Alam
Hard Real Time Systems
? Guarantees that critical tasks are completed on time
? Secondary storage is limited or absent, data is stored
in short term memory OR read-only memory (ROM)
? ROM will be nonvolatile storage device
? Most advance operating system operations are
absent
? Conflicts with time-sharing systems as most
advanced OS features are absent.
? Not supported by general-purpose operatingsystems.
8/8/2019 AOS01 Intro
15/29
Advanced OS : Dr. M. Alam
Soft Real Time Systems
? Less restrictive
? A critical real-time task gets priority
?
Limited utility in industrial control or robotics? Useful in applications (multimedia, virtual
reality) requiring advanced operating-system
features
? It is added to most recent Operating Systems
including major versions of UNIX
Advanced OS : Dr. M. Alam
Handheld Systems
? Personal Digital Assistants (PDAs)
? Cellular Telephones
? Issues:
? Limited Memory
? Slow Processors
? Small Display Screens
? Smaller Bandwidth
8/8/2019 AOS01 Intro
16/29
Advanced OS : Dr. M. Alam
Working of Operating Systems
Advanced OS : Dr. M. Alam
Starting of OS
? Turn on or restart the computer system, activates the
bootstrap loader
? Bootstrap
? Initializes the hardware (Interrupts)
? Read OS from somewhere ( Memory or disk or network )
? OS loads and starts a user-level 'init' program
? init starts an original collection of processes,
usually specified by a configuration file
?
typically including a login authorization program for eachterminal line or other input device
8/8/2019 AOS01 Intro
17/29
Advanced OS : Dr. M. Alam
Starting of OS (Continue)
? init also starts other 'daemon' processes such as
? Network management and services,
? Time service,
? Batch job manager,
? When user login to a terminal, the login process
? Creates ashellfor user as a sub-process.
? Then waits for the shell to terminate that is done
when user logoff
? In case ofrlogin, it is a network service daemon
that creates theshellfor user
Advanced OS : Dr. M. Alam
Invoking a System Call
Steps involved to invoke a system call
Communication: User ? OS?
How to request the services?
8/8/2019 AOS01 Intro
18/29
Advanced OS : Dr. M. Alam
Structure of Operating Systems
Advanced OS : Dr. M. Alam
Structure of Operating Systems
1. Monolithic System2. Layered System
3. Virtual Machines
4. Client-Server Model
8/8/2019 AOS01 Intro
19/29
Advanced OS : Dr. M. Alam
Monolithic System
Advanced OS : Dr. M. Alam
Monolithic System
? OS is a collection of procedures (System Calls)? Procedures or files containing procedures are
compiled and then bind all together
? Dont care about information hiding
? Procedures can call each other freely
? Each procedure has well defined parameters &
results
8/8/2019 AOS01 Intro
20/29
Advanced OS : Dr. M. Alam
Model
Organized in Three Layers
Advanced OS : Dr. M. Alam
Basic Organization
1. Main Procedure : Invokes services procedures2. Service Procedures : Carry out the system calls
3. Utility Procedures : Helps the service procedures
? One system call against one service procedure
? Utility procedures do job required by service
procedures (e,g. fetch data from user program)
8/8/2019 AOS01 Intro
21/29
Advanced OS : Dr. M. Alam
Functionality
1. User program request service by invoking system call
2. Procedure puts parameters in registers or on stack and
issues the trap instruction (Kernel or Supervisor call)
3. Machine switches from user mode to kernel mode4. Control is transfer to OS
5. OS checks parameters? Which system call ?
6. OS indexes to table that contains the pointer to required
procedure
7. Service procedure is identified and then called
8. System call is finished & control is given back to user
program
Advanced OS : Dr. M. Alam
Layered System
8/8/2019 AOS01 Intro
22/29
Advanced OS : Dr. M. Alam
Layered System
Structure ofTHE (Technische Hogeschool Eindhoven)Operating System
? OS is organized as h ierarchy of six layers
? Simple batch system
The Operator5
User Programs4
I/O management3
Operator Process Communication2
Memory & Drum Management1
Processor Allocation & Multiprogramming0
?MULTICS ? Concentric Rings
Advanced OS : Dr. M. Alam
Layer 0 & Layer 1
? Allocate processors? Switches between processes (When interrupts occur or
timer expiration)
? Multiprogramming : Sequential processes are
programmed without knowing that multiple processes
are running on a single processor
? Allocate space for processes in main memory
?
For larger process, extra part is placed on disk/drum? Responsible to bring pages into memory when needed
Layer 0
Layer 1
8/8/2019 AOS01 Intro
23/29
Advanced OS : Dr. M. Alam
Layer 2 & Layer 3
? Communicate between process & operator
console
? Each process has its own operator console
Layer 2
Layer 3
? Manages I/O devices
? Buffers information stream to & from I/O
? A process can handle abstract I/O devices nicely
Advanced OS : Dr. M. Alam
Layer 4 & Layer 5
? Contains user programs
? User program do not need to bother about
process, memory, console or I/O management
Layer 5
Layer 4
? Contains system operator process
8/8/2019 AOS01 Intro
24/29
Advanced OS : Dr. M. Alam
Virtual Machine
Advanced OS : Dr. M. Alam
Virtual Machines
? VM/370 based on observation that a timesharing system provides1. Multiprogramming and
2. An extended machine with more convenient interfacethan the bare H/W
8/8/2019 AOS01 Intro
25/29
Advanced OS : Dr. M. Alam
Virtual Machine Monitor (VMM)
? Performs multiprogramming
? Runs on bare H/W
? Provides several virtual machines to next layer.
? These are not extended machines with files & other
nice features but these are exact copies of bare H/W
(including kernel / user mode, I/O interrupts, & .
like real machine)
? Each virtual machine is identical, one can run any OS
that will run directly on H/W
? Different virtual machines may run different OS
Advanced OS : Dr. M. Alam
Conversational Monitor System
? CMS executes system call
? Call is trapped to the OS in its own virtual
machine just like running on real machine
? Example: Read Data
? CMS issues hardware I/O instructions for reading
required data
? I/O instructions are trapped by VM/370
? VM treats instruction as part of simulation of the real
H/W
8/8/2019 AOS01 Intro
26/29
Advanced OS : Dr. M. Alam
Client-Server Model
Advanced OS : Dr. M. Alam
Client-Server Model
? Goal: Develop most OS functions in user
processes & leavingminimal kernelin OS
? Invoking a service:
? User process (client process) sends request toserver process
? Then server process performs the job & sendresults
? Kernel
? Handle communication between clients andservers
? provides low-level resource management
8/8/2019 AOS01 Intro
27/29
Advanced OS : Dr. M. Alam
Basic Organization
? Modular Approach:
? Divide OS into parts
? Each part handles one module (set of specificservices) of the system
? Such as file service, process service, terminalservice, memory service,
Advanced OS : Dr. M. Alam
Features
? Modular Approach is easier to understand
? Management is easier for smaller part
? Servers
? Run as user-mode process instead of kernel-mode
? Do not have direct access to H/W
? Any failure in a server will cause the crash in
that particular service not in the whole system
8/8/2019 AOS01 Intro
28/29
Advanced OS : Dr. M. Alam
Application in Distributed System
? Can be used in distributed systems
? Client communicate with server through messages
?
Client do not know that message is treated locallyor remotely
? Kernel conveys the messages only
Kernel
PE 4
Memory ServerClient
Kernel
PE 1
File Server
Kernel
PE 2
Process Server
Kernel
PE 3
Messaging
Advanced OS : Dr. M. Alam
Summery
? What is an Operating System
? What is a Computer System
? How OS & computer system affect
each other
8/8/2019 AOS01 Intro
29/29
Advanced OS : Dr. M. Alam
Assignment
Write a brief report about an OS including itsdistinguished features & limitations
? Windows
?
DOS? IRIX
? Linux
? Unix
? Free BSD Unix
? Solaries
? ..
Advanced OS : Dr. M. Alam
Research Topics
Choose a research paper/topic for writing the
report that you have to submit
? Deadlock Prevention
? Multiple Locks
? OS for Mobile Equipments
? Synchronization
? Scheduling
? .