Input-Output Management-2
Input-Output Management-2
I/O management module must try to minimize the disparity by the use
of techniques like buffering and spooling.
PRINCIPLES OF I/O HARDWARE
• Block devices
• A block device is one that stores information in fixed-size
blocks, each one with its own address.
Heat sink
x1 PCIe Connector
PCI Connectors
Cont.
• The controller card usually has a connector (port) on it,
into which a cable leading to the device itself can be
plugged.
Programmed I/O.
Interrupt- initiated I/O.
Direct memory access( DMA).
Programmed I/O
With programmed I/O, data are exchanged between the
processor and the I/O module.
Advantages
simple to implement
very little hardware support
Disadvantages
busy waiting
ties up CPU for long period with no useful work
Interrupt Driven I/O
.
Cont.
The interrupt technique requires more complex hardware
and software, but makes far more efficient use of
the computer’s time and capacities.
Basic Operations of Interrupt
Advantages
fast
efficient
Disadvantages
can be tricky to write if using a low level language
can be tough to get various pieces to work well together
usually done by the hardware manufacturer / OS maker, e.g.
Microsoft
Cont.
Note: Both the methods programmed I/O and Interrupt-
driven I/O require the active intervention of the processor
to transfer data between memory and the I/O module, and
any data transfer must transverse a path through the
processor.
Advantages
allows a peripheral device to read from/write to memory
without going through the CPU
allows for faster processing since the processor can be
working on something else while the peripheral can be
populating memory
Disadvantages
requires a DMA controller to carry out the operation, which
increases the cost of the system
cache coherence problems
Buffering
A buffer is a memory area that stores data being transferred
between two devices or between a device and an application.
Block oriented –
There are two buffers in the system. One buffer is used by
the driver or controller to store data while waiting for it to
be taken by higher level of the hierarchy.
Stream oriented –
Line- at a time I/O, the user process need not be
suspended for input or output, unless process runs ahead
of the double buffer.
Double Buffering
Circular buffer
When more than two buffers are used, the collection of
buffers is itself referred to as a circular buffer.
In this, the data do not directly passed from the producer
to the consumer because the data would change due to
overwriting of buffers before they had been consumed.
On receiving output data, it stores it on hard disk and enters the
job in a spool queue.