You are on page 1of 18

INPUT OUPUT MANAGEMENT

 Classification and characteristics of input/output devices


  Input/output device controller

  Perform Input/output and organize Input/output system


  Input/output mechanism and DMA mechanism


  The scheduling algorithm to move the reader


  Coefficient of interleaving and RAM DISK



Classify input/output device
 Block device:
 Information is read/written in blocks of a fixed size and has a
specified address.
 Hard disk.
 Sequential device:
 Information is sent/received in sequential sequences of bits,
without addresses.
 Monitor, keyboard, printer, network card, mouse.
 Other equipment:
 There are a number of devices that do not match these two types
 Clock.
Features of input/output device
 Data transfer rate:
 keyboard: 0.01 KB/s, mouse 0.02 KB/s ...
 Storage capacity
 Time to access a data unit.
 Uses: used to input or output
 Data transmission unit: transmitted by block or character
 Data representation: this depends on the specific device.
 Error status:
 the cause of the error, the way the device reported an error ...
Access time and capacity of some I/O devices

Access time Capacity


I/O device controller

 Hardware controls directly the I/O devices


 I/O devices and controllers must follow the same
communication standards as ANSI, IEEE or ISO
standards ...
I/O device controller
I/O controller I/O address Interrupt Vector
(address of registers)
Clock 040 - 043 8
Keyboard 060 - 063 9
Secondary RS232 2F8 - 2FF 11
Hard disk 320 - 32F 13
Printer 378 - 37F 15
Mono Monitor 380 - 3BF -
Color Monitor 3D0 - 3DF -
Floppy disk 3F0 - 3F7 14
Main RS232 3F8 - 3FF 12
Programs to input/output
Organize input/output system
Organize input/output system

When the disk read operation is complete, the disk controller will
generate an interrupt
Input/Output mechanism
 Mechanism 1:
 The CPU generates an I/O command to the I/O devices
 Wait until the I/O operation is complete and continue
processing
 Mechanism 2:
 The CPU generates an I/O command to the I/O devices
 Continue processing until an interrupt is received from the I/O
device indicating that having finished input/output
 The CPU pauses the current processing to switch to the
interrupt handler
 Mechanism 3: DMA
DMA mechanism (Direct Memory
Access)
The scheduling algorithm to move the reader

 seek time + latency time + transfer time


FCFS Algorithm (first-come, first-served)

 The algorithm will move the reader in the correct order to the
order of the blocks to be read
 Order of blocks to read: 98, 183, 37, 122, 14, 124, 65, and 67.
 Reader is in position 53

Steps to move the reader according to the FCFS algorithm


SSTF Algorithm (shortest-seek-time-first)

 The algorithm will move the reader one by one to the


blocks to be read according to the position closest to the
current position of the reader.
 Blocks to read: 98, 183, 37, 122, 14, 124, 65, and 67.
 Reader is in position 53

Steps to move the reader according to the SSTF algorithm


SCAN Algorithm

 The algorithm will move the reader to one side of the


disk then moves to the other.
 Blocks to read: 98, 183, 37, 122, 14, 124, 65, and 67.
 Reader is in position 53

Steps to move the reader according to the SCAN algorithm


C-SCAN Algorithm

 Similar to the SCAN algorithm, the only difference


is that when it moves to a certain end of the disk, it
will immediately return to the beginning of the disk.

Steps to move the reader according to the C-SCAN algorithm


Coefficient of interleaving

(a) interleave=0, (b) interleave=1, (c) interleave=2

 Example: suppose the system has 17 sectors/tracks, and interleave = 3 then


the sectors are arranged in the following order: 1, 14, 10, 6, 2, 15, 11, 7, 3, 16,
12, 8, 4, 17, 13, 9, 5
 How to read in turn as follows:
 1st : 1, 2, 3, 4, 5
 2nd : 6, 7, 8, 9, 10
 3rd : 11, 12, 13, 14, 15
 4th : 16, 17
Ram disk
 Use a part of main memory to store disk blocks ->
Ram Disk.
 is divided into blocks, each block is the size of the
block on the disk.
 perform read/write in Ram disk before executing
on disk.
 Quick access, no waiting for spinning or searching
 Suitable for storing frequently accessed programs
or data

You might also like