OS - Chapter # 10
OS - Chapter # 10
CHAPTER #
10
Operating Systems
Chapter 10 - Outline
SHEHERYAR MAL
IK
Input/Output organization
Objectives of I/O system
Unix I/O system
MS-DOS I/O system
Device drivers in windows
Disk structure
Seek time
Latency
Disk scheduling
FCFS
SSTF
Scan scheduling
Data rate
Disk: 2Mbytes/sec
Keyboard: 10-15bytes/sec
Unit of transfer
Disk: blocks (e.g. block of 1024bytes)
Screen: single character
Operations
Disk: read, write, seek etc
Printer: write, move paper
Error conditions
Disk: read errors
Printer: paper out
Device Drivers
It is a software module which manages the communication with, and
control of a specific I/O device
It converts user’s logical request into specific commands directed to
the device
Device Controllers
A device controller is a hardware unit attached to the I/O bus of the
computer
It provides a hardware interface between the computer and the I/O
device
Device
I/O devices are designed to be used in a wide range of different
computer systems
I/O devices can be categorized into block and character devices
A virtual device is a simulation of an actual device by the operating
system, e.g. print spooler
If the reader head is at track 53, it will first move from 53 to 98, then
to 183 and so on
The total head movement is 640 tracks
If the requests for the tracks 37 and 14 could be served together, the
total head movement could be decreased substantially
In this way, the average time to service each request would decrease,
improving disk throughput
The shortest seek time first disk scheduling algorithm selects the
request with minimum seek time from the current head position
SSTF results in a total head movements of only 236 tracks
Comparing with FCFS, SSTF results in substantial improvements
Assume that we have just two requests in queue, 14 and 186
If a request near 14 are arrives while serving that request, it will be
served next
Request for track 186 may wait indefinitely, if more requests near
14 are arriving continuously
In this algorithm, the head continuously scans the disk from end to
end
The read-write head starts at one end of the disk, and moves towards
the other end
Assume that head is moving from track 53 towards 0, the head
movement would service 37, 14 and then moves to 0
At track 0, the head would reverse and move to other end of the disk
serving requests at 65, 67, 98, 122, 124 and 183
Any new request in front of head will be served immediately
A request just behind the head will have to wit until the head moves
to the end of the disk and reverse its direction
Scan algorithm is also called Elevator algorithm
This algorithm is little bit better than SSTF