Operating System: Ajaz Khan Baig
Operating System: Ajaz Khan Baig
BOOK:
Operating System Concepts
by Silberschatz and Galvin , 8 th
Edition
08/25/20 2
Review of OS Environments
Computer-System Structures
Computer System Operation
Interrupts
Interrupts handling
I/O Structure
Storage Structure
Storage Hierarchy
Hardware Protection
General System Architecture
08/25/20 3
Batch processing:
08/25/20 4
Problems:
Lack of interaction between the user and job.
CPU is often idle, because the speeds of the mechanical I/O
devices are slower than CPU.
Difficult to provide the desired priority.
08/25/20 5
Mainframe Systems:
Reduce setup time by batching similar jobs
Automatic job sequencing – automatically transfers control
from one job to another.
Resident monitor
Initial control in monitor
Control transfers to job
When job completes control transfers pack to monitor
08/25/20 6
Multi-programmed Batch Systems
08/25/20 7
Multiprogramming:
08/25/20 8
OS Features Needed for Multiprogramming:
CPU scheduling – the system must choose among several jobs ready to
run.
Allocation of devices
08/25/20 9
Time-sharing or multitasking is a logical extension of multiprogramming.
Operating system uses CPU scheduling and multiprogramming to provide each user
with a small portion of a time.
08/25/20 10
Multitasking:
08/25/20 11
Advantages:
08/25/20 12
Problem of reliability (dependability ,uniformity regularity) .
08/25/20 13
Distributed systems use multiple central processors to serve
multiple real time application
Data processing jobs are distributed among the processors
08/25/20 14
Multiple independent CPUs or processors in a computer system.
Core Activities:
08/25/20 15
Advantages:
With resource sharing facility user at one site may be able to use the resources available at
another
Speedup the exchange of data with one another via electronic mail
If one site fails in a distributed system, the remaining sites can potentially continue
operating.
Better service to the customers
Reduction of the load on the host computer
Reduction of delays in data processing
08/25/20 16
Time sharing is a technique which enables many people, located at various
terminals, to use a particular computer system at the same time
08/25/20 17
Runs on a server
OS provides server the capability to manage data, users, groups etc.
Example:
MS Windows 2003 and 2008
08/25/20 18
Advantages:
Provide advantage of quick response
Avoids duplication of software
Reduces CPU idle time
Disadvantages:
Problem of reliability.
Question of security of user programs and data.
Problem of data communication.
08/25/20 19
Real time systems are usually dedicated embedded systems.
08/25/20 20
08/25/20 21
I/O devices and the CPU can execute concurrently.
Each device controller is in charge of a particular device
type.
Each device controller has a local buffer.
CPU moves data from/to main memory to/from local
buffers
I/O is from the device to local buffer of controller.
Device controller informs CPU that it has finished its
operation by causing an interrupt.
08/25/20 22
People like connecting devices
A computer is much more than the CPU
Keyboard, mouse, screen, disk drives
Scanner, printer, sound card, camera, etc.
These devices occasionally need CPU service
But we can’t predict when
External events typically occur on a macroscopic timescale
we want to keep the CPU busy between events FNeed a way for
CPU to find out devices need attention
08/25/20 23
Interrupt transfers control to the interrupt service routine generally, through the
interrupt vector, which contains the addresses of all the service routines.
Incoming interrupts are disabled while another interrupt is being processed to prevent
a lost interrupt.
08/25/20 24
The operating system preserves the state of the CPU by
storing registers and the program counter.
Determines which type of interrupt has occurred:
polling
vectored interrupt system
08/25/20 25
Polling interrupts:
CPU periodically checks each device to see if it needs service
takes CPU time even when no requests pending
Overhead may be reduced at expense of response time ¸ can be
efficient if events arrive rapidly
Give each device a wire (interrupt line) that it can use to signal
the processor
When interrupt signaled, processor executes a routine called an
08/25/20 27
Interrupt Time Line For a Single Process Doing Output
08/25/20 28
After I/O starts, control returns to user program only upon I/O completion.
Wait instruction idles the CPU until the next interrupt
Wait loop (contention for memory access).
At most one I/O request is outstanding at a time, no simultaneous I/O processing.
After I/O starts, control returns to user program without
waiting for I/O completion.
System call – request to the operating system to allow user to wait for
I/O completion.
Device- status table contains entry for each I/O device indicating its type,
address, and state.
Operating system indexes into I/O device table to determine device status and to
modify table entry to include interrupt.
08/25/20 29
synchronous asynchronous
08/25/20 30
08/25/20 31
Used for high-speed I/O devices able to transmit information
at close to memory speeds.
Device controller transfers blocks of data from buffer storage
directly to main memory without CPU intervention.
Only on interrupt is generated per block, rather than the one
interrupt per byte.
08/25/20 32
Main memory – only large storage media that the CPU can access directly.
Disk surface is logically divided into tracks, which are subdivided into
sectors.
The disk controller determines the logical interaction between the
device and the computer. 08/25/20 33
08/25/20 34
Storage systems organized in hierarchy.
Speed
Cost
Volatility
08/25/20 35
Interrupts :
Interrupts are very useful to handle multiple processes.
Basically interrupts is the foundation for multiprocessing.
Interrupt transfers control to the interrupt service routine generally, through the
interrupt vector, which contains the addresses of all the service routines.
DMA:
Used for high-speed I/O devices able to transmit information at close to memory speeds
Main memory
– only large storage media that the CPU can access directly.
Secondary storage
– extension of main memory that provides large nonvolatile storage capacity.
Magnetic disks
– rigid metal or glass platters covered with magnetic recording material
08/25/20 36
In this lecture, we reviewed the operating system
environments
We discussed operating system structure , storage structure,
storage hierarchy , interrupts and I/O structure with
explanation and diagrams
08/25/20 37