DEVICE 
MANAGEMENT 
BY ANIL KUMAR 
DEPT. OF COMPUTER SCIENCE 
KABARAK UNIVERSITY, KENYA
THE MAIN FUNCTIONS OF DEVICE MANAGEMENT ARE:- 
• Keep track of all device/peripherals. 
• Decide which process gets the device, when and for how much time. 
• Allocate the device and initiate the I/O operation. 
• Deallocate the devices. This is done at two levels: 
When I/O command has been executed, the device is temporarily 
released. 
As the process terminated, the device is permanently released.
DISK STRUCTURE
THE TIME TO READ OR WRITE A DISK BLOCK CONSISTS 
OF THREE FACTORS:- 
• Seek time: - It is the time consumed to move the arm to proper cylinder. 
• Latency time: - It is the time required for searching the required sector. 
• Transfer time: - It is the time required to transfer data from the sector to the 
memory. 
Thus the total time to access a disk request is equal to the sum of seek time, 
latency time and the transfer time. 
When a disk drive receives one request, there is no problem. But when there is 
more than one request, then which one is to be scheduled first, is the challenge. 
The process of scheduling a request among several requests is called the disk 
scheduling.
DISK SCHEDULING ALGORITHMS 
The algorithm used to select which I/O request is going to be satisfied first is 
called “disk scheduling algorithm”. 
Various disk scheduling algorithms are:- 
• First come first serve (FCFS) scheduling. 
• Shortest seek time first (SSTF) scheduling. 
• Scan scheduling. 
• Circular scan (C-SCAN) scheduling. 
• Look scheduling.
DISK SCHEDULING ALGORITHMS , EXAMPLES 
Lets consider a disk queue with request of I/O to block on cylinder . 98, 183, 37, 122, 
14, 124, 65, 67 
If the disk head is initially at cylinder 53, then calculate total number of head 
movements using following algorithms: 
Starts from next slide………
FCFS 
0 14 37 53 65 67 98 122 124 19183 9 
USING FCFS SCHEDULING TOTAL HEAD MOVEMENT IS: 
= (98-53)+(183-98)+(183-37)+(122-37)+(122-14)+(124-14)+(124- 
65)+(67-65) 
= 45+ 85+146+85+108+110+59+2 
= 640 cylinders.
SSTF 
0 14 37 5 3 65 67 98 122 124 183 199 
USING SSTF SCHEDULING TOTAL HEAD MOVEMENT IS: 
= (65-53)+(67-65)+(67-37)+(37-14)+(98-14)+(122-98)+(124-122)+(183- 
124) 
= 12+2+30+23+84+24+2+59 
= 236 cylinders.
SCAN 
0 14 37 53 65 67 98 122 124 183 199 
USING SCAN SCHEDULING TOTAL HEAD MOVEMENT IS: 
=(53-37)+(37-14)+(14-0)+(65-0)+(67-65)+(98-67)+(122-98)+(124- 
122)+(183-124) 
= 16+23+14+65+2+31+24+2+59 
= 236 cylinders.
C-SCAN 
0 14 37 53 65 67 98 122 124 183 199 
USING C-SCAN SCHEDULING TOTAL HEAD MOVEMENT IS: 
= (65-53)+(67-65)+(98-67)+(122-98)+(124-122)+(183-124)+(199- 
183)+(14-0)+(37-14) 
=12+2+31+24+2+59+169+14+23 
=336 cylinders
LOOK 
0 14 37 53 65 67 98 122 124 183 199 
USING LOOK SCHEDULING TOTAL HEAD MOVEMENT IS: 
= (65-53)+(67-65)+(98-67)+(122-98)+(124-122)+(183-124)+(183- 
14)+(37-14) 
=12+2+31+24+2+59+169+23 
=322 cylinders

Device Management

  • 1.
    DEVICE MANAGEMENT BYANIL KUMAR DEPT. OF COMPUTER SCIENCE KABARAK UNIVERSITY, KENYA
  • 2.
    THE MAIN FUNCTIONSOF DEVICE MANAGEMENT ARE:- • Keep track of all device/peripherals. • Decide which process gets the device, when and for how much time. • Allocate the device and initiate the I/O operation. • Deallocate the devices. This is done at two levels: When I/O command has been executed, the device is temporarily released. As the process terminated, the device is permanently released.
  • 3.
  • 4.
    THE TIME TOREAD OR WRITE A DISK BLOCK CONSISTS OF THREE FACTORS:- • Seek time: - It is the time consumed to move the arm to proper cylinder. • Latency time: - It is the time required for searching the required sector. • Transfer time: - It is the time required to transfer data from the sector to the memory. Thus the total time to access a disk request is equal to the sum of seek time, latency time and the transfer time. When a disk drive receives one request, there is no problem. But when there is more than one request, then which one is to be scheduled first, is the challenge. The process of scheduling a request among several requests is called the disk scheduling.
  • 5.
    DISK SCHEDULING ALGORITHMS The algorithm used to select which I/O request is going to be satisfied first is called “disk scheduling algorithm”. Various disk scheduling algorithms are:- • First come first serve (FCFS) scheduling. • Shortest seek time first (SSTF) scheduling. • Scan scheduling. • Circular scan (C-SCAN) scheduling. • Look scheduling.
  • 6.
    DISK SCHEDULING ALGORITHMS, EXAMPLES Lets consider a disk queue with request of I/O to block on cylinder . 98, 183, 37, 122, 14, 124, 65, 67 If the disk head is initially at cylinder 53, then calculate total number of head movements using following algorithms: Starts from next slide………
  • 7.
    FCFS 0 1437 53 65 67 98 122 124 19183 9 USING FCFS SCHEDULING TOTAL HEAD MOVEMENT IS: = (98-53)+(183-98)+(183-37)+(122-37)+(122-14)+(124-14)+(124- 65)+(67-65) = 45+ 85+146+85+108+110+59+2 = 640 cylinders.
  • 8.
    SSTF 0 1437 5 3 65 67 98 122 124 183 199 USING SSTF SCHEDULING TOTAL HEAD MOVEMENT IS: = (65-53)+(67-65)+(67-37)+(37-14)+(98-14)+(122-98)+(124-122)+(183- 124) = 12+2+30+23+84+24+2+59 = 236 cylinders.
  • 9.
    SCAN 0 1437 53 65 67 98 122 124 183 199 USING SCAN SCHEDULING TOTAL HEAD MOVEMENT IS: =(53-37)+(37-14)+(14-0)+(65-0)+(67-65)+(98-67)+(122-98)+(124- 122)+(183-124) = 16+23+14+65+2+31+24+2+59 = 236 cylinders.
  • 10.
    C-SCAN 0 1437 53 65 67 98 122 124 183 199 USING C-SCAN SCHEDULING TOTAL HEAD MOVEMENT IS: = (65-53)+(67-65)+(98-67)+(122-98)+(124-122)+(183-124)+(199- 183)+(14-0)+(37-14) =12+2+31+24+2+59+169+14+23 =336 cylinders
  • 11.
    LOOK 0 1437 53 65 67 98 122 124 183 199 USING LOOK SCHEDULING TOTAL HEAD MOVEMENT IS: = (65-53)+(67-65)+(98-67)+(122-98)+(124-122)+(183-124)+(183- 14)+(37-14) =12+2+31+24+2+59+169+23 =322 cylinders