Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Introduction IO System Introduction IO System

The operating system must be able to control a large Device driver modules are used to control a particular
variety of IO devices. These devices vary greatly in device. These drivers will either be shipped with the
functionality and speed. The IO sub-system of the device or they will be part of the operating system’s
kernel manages these devices. distribution.

Although IO devices are becoming more standard, there Kernel


is also an ever increasing variety of IO devices. Oper-
ating systems must cope with these conflicting trends. Kernel Sub-System Software

SCSI Mouse display floppy


device device device device
driver driver driver driver

SCSI mouse display floppy


controller controller controller controller

Hardware

SCSI mouse display floppy

1 2

IO Hardware IO System IO Hardware IO System

Types of IO hardware include: Although there is a huge variety of devices there is


only a few ways a computer may view these devices.

storage devices (disks, tapes),


Devices may communicate with the computer via a
connection point termed a port. Devices may also
transmission devices (network cards, modems), communicate with the computer via a common set
and of wires called a bus. Both ports and buses have a
rigged set of well defined protocols.

human-interface devices (screen, keyboard, mouse, A controller is a piece of electronics that operates:
microphones). 

a port,

a bus, or

a device.

3 4
IO Hardware IO System Controller IO System

Keyboard Serial port CPU The processor typically communicates with the con-
troller via registers such as:
cache 

status — is read to obtain information about the device,

expansion bus interface memory memory controller 

control — is written to direct the device,

data-in — is written to give information to the device, and

IDE disk controller graphics controller




data-out — is read to obtain information from the device.

Hard These registers are accessed either via:


Disk CD-Rom display

special IO instructions, or
PC bus structure

memory mapped IO (From the CPU’s perspective


these look like ordanary memory addresses.).

5 6

IO Hardware IO System Application IO Interface IO System

Depending on the type of IO required different ap- Although there is a large variety of devices it is useful
proaches may be used to coordinate the IO. These
for user programs to access the IO through a stan-
include:
dard interface. This abstracts away the details of dif-
ferences in IO devices.
Polling — an approach that repeatedly checks the
status register of a device’s controller to perform The types of devices includes:
an IO operation. 

character-stream or block,


sequential or random-access,
Interrupts — an interrupt is raised by a device and
caught by the CPU, this is dealt with by a device 

synchronous or asynchronous,
driver pointed to by the interrupt vector. This en- 

sharable or dedicated,
ables the computer to deal with asynchronous or
urgent events. 

speed of operation, and




read-write, read only, or write only.


DMA — enables blocks of memory to be trans-
ferred between memory and devices. This frees
The operating system may also provide special sys-
the CPU from performing mindless programed IO
tem calls to access devices such as: time of day clock,
(PIO).
timer, graphical display, and audio.
7 8
Services IO System Performance IO System

The kernel’s IO sub-system provides numerous ser- Performance of the IO sub-system is a critical issue
vices. These include: in modern computer systems as they are required to
perform vast amounts of IO.
IO scheduling,
This IO places heavy demands on:

buffering,
the device driver code,
spooling,
process scheduling,
error handling,
interrupt-handling mechanisms, and
device reservation, and

the memory bus.


name translation.

9 10

Performance IO System

Approaches that may be employed to improve perfor-


mance include:

reduce context switches,

decrease the amount of memory that must be


copied,

decrease the amount of interrupts generated(larger


transfers, smart controllers and polling)

use DMA, and

move basic computation into dedicated hardware.

11

You might also like