Functions:
The roles of OS in computer are to manage and control I/O
operations and devices.
These I/O devices can be grouped to 3 categories:-
1. Human readable: - These types of I/O devices establish
communication between user and computer, e.g. Keyboard, Mouse etc.
2. Machine readable: - Suitable for communication with
electronic equipment, e.g. disk drives, sensors, controllers etc.
3. Communication: - Suitable for communication with remote
devices, e.g. MODEM.
Data rate:
Data rate varies between I/O devices to devices. Out of all
devices, keyboard is the least data transmission rate. Graphics display is the
highest data transmission rate.
Unit of
transfer:
Data may be
transferred as a stream of bytes or characters e.g. terminal (keyboard) or in
large blocks (a disk).
Organisation
of I/O function:
1. Programmed I/O
2. Interrupt driven I/O
3. Direct Memory access
IO
hardware:
1] A device
communicates with a computer system by sending singles over a cable, the device
communicates with the machine via a connection point, called port.(serial port,
parallel port)
2] If one or more devices use a common set of wires the
connection is called a Bus.
3] The PCI (peripheral component interconnect) Bus connects
the processor-memory sub-system through fast devices, and an expansion bus that
connects relatively slow devices such as keyboard, serial port and parallel.
4] SCSI (small computer system interface) is plugged into
SCSI controller.
5] A controller is a collection of electronic that can
operate a port a bus or a device. The processor communicates with the
controller by reading and writing bit pattern in register.
Disk Structure:
1] A hard disk is a collection of platter, each dick platter
have circular shape like ac, two surface of a platter is covered with a
magnetic material
2] a read-write head located just above each surface of every platter. The space of platter is logically divided into circular track, tracks are subdivided into sectors.
Disk
performance Parameters:
1] Seek Time: The time required to reach the desire track by
read-write head is the seek time.
The liner formula for seek time is:
Ts
(seek time)= m*n+s
(n=number of tracks, m= constant that
depends on the disk drive, s= startup time)
2] Rotational Delay: The time is required to desire sector
by the read write head is the Rotational delay.
(generally, Avg rotational delay is between 100-200ms)
3] Transfer Time: The transfer time depends on the rotation
speed of the disk.
The liner formula for Transfer time is:
T = b/r
*n
(T= transfer rate, b= number of bytes transfer, n = number
bits on track, r = Rotation speed of revolution per sec )
Thus the total Avg access time is (Ta) = Ts + ½r+(b*n)/r

There are no. of disk scheduling algorithm available, out of
those highly used everywhere, those are-
1] FCFS (first come first serve) Scheduling
2] SSTF (shorted seek time first) Scheduling
3] Scan scheduling
4] C-scan Scheduling
5] Look scheduling
FCFS Scheduling: First come
first served, it is simplest Disk Scheduling algorithm of all but it does not provide
the fastest service.
Q) Consider a disk queue with request for I/O
87,170,40,150,36,72,66,15(the disk head is initially at cylinder 60)
Find average head movement?
Using FCFS
Total head movement:-
60-87+87-170+170-40+40-150+150-36+36-72+72-66+66-15
27+83+130+110+114+36+6+51
= 557 cylinders
Avg. head movement are 557/8 cylinders = 69.625 cylinders
Using SSTF
This Algo. selects the with the minimum seek time then the
current head position
Total head movement:-
60-66+66-72+72-87+87-40+40-36+36-14+14-150+150-170
6+15+47+4+21+135+20
=254 cylinders
Avg. head movement are 254/8 cylinders = 31.75
Scan Scheduling: The scan
algorithm is called elevator algorithm. In this the disk arm stars at one end
of the disk and moves towards the other end, while in the meantime all requests
are servicing until it gets the other end of the disk. At the other end the
direction of the head movement is reversed and servicing continues.
C Scan Scheduling: The main
drawback in scan scheduling is that the waiting time is not uniform. In this
algorithm head moves from one end to other end of the disc servicing the
request along the way.
Note: The average head movement in C-Scan scheduling is more
than scan scheduling. But it provides more uniform wait rate.
Look Scheduling: In the
C-Scan Scheduling the disk arm moves across the full width of disk but in Look
Scheduling algorithm the arm goes only as far as the final request in each
direction. Then it reverses the direction immediately without going to the end
of the disk.
Comments
Post a Comment