Print Friendly and PDF
Overview

Computers operate on many kinds ofdevices. General types include storage devices (disks, tapes),
transmission devices (network cards, modems), and human-interface devices (screen, keyboard, mouse).
Other devices are more specialized. A device communicates with a computer system by sending sig nals over a
cable or even throug h the air.
The device communicates with the machine via a connection point termed a port (for example, a serial port). If
one or more devices use a common set ofwires, the connection is called a bus.In other terms, a bus is a set of
wires and a rig idly defined protocol that specifies a set ofmessag es that can be sent on the wires.


Daisy chain


When device A has a cable that plug s into device B, and device B has a cable that plug s into device C, and device
C plug s into a port on the computer, this arrang ement is called a daisy chain. It usually operates as a bus.


Controller


A controller is a collection ofelectronics that can operate a port, a bus, or a device. A serial-port controller is an
example ofa simple device controller. This is a sing le chip in the computer that controls the sig nals on the wires
ofa serial port.
The SCSI bus controller is often implemented as a separate circuit board (a host adapter) that plug s into the
computer. It contains a processor, microcode, and some private memory to enable it to process the SCSI
protocol messag es. Some devices have their own built-in controllers.


I/O port


An I/O port typically consists offour reg isters, called the status , control, data-in, and data-out reg isters.

S.N. Reg ister & Description


1 Status Reg ister
The status reg ister contains bits that can be read by the host. These bits indicate states such as
whether the current command has completed, whether a byte is available to be read from the data-in
reg ister, and whether there has been a device error.


2 Control reg ister


The control reg ister can be written by the host to start a command or to chang e the mode ofa device.
For instance, a certain bit in the control reg ister ofa serial port chooses between full-duplex and halfduplex communication, another enables parity checking , a third bit sets the word leng th to 7 or 8 bits,
and other bits select one ofthe speeds supported by the serial port.


3 Data-in reg ister


The data-in reg ister is read by the host to g et input.

4 Data-out reg ister
The data out reg ister is written by the host to send output.

Polling


Polling is a process by which a host waits for controller response.It is a looping process, reading the status
reg ister over and over until the busy bit ofstatus reg ister becomes clear. The controller uses/sets the busy bit
when it is busy working on a command, and clears the busy bit when it is ready to accept the next command. The
host sig nals its wish via the command-ready bit in the command reg ister. The host sets the command-ready bit
when a command is available for the controller to execute.
In the following example, the host writes output throug h a port, coordinating with the controller by handshaking
The host repeatedly reads the busy bit until that bit becomes clear.
The host sets the write bit in the command reg ister and writes a byte into the data-out reg ister.
The host sets the command-ready bit.
When the controller notices that the command-ready bit is set, it sets the busy bit.
The controller reads the command reg ister and sees the write command.
It reads the data-out reg ister to g et the byte, and does the I/O to the device.
The controller clears the command-ready bit, clears the error bit in the status reg ister to indicate that the
device I/O succeeded, and clears the busy bit to indicate that it is finished.


I/O devices


I/O Devices can be categ orized into following categ ory.


S.N. Categ ory & Description


1 Human readable


Human Readable devices are suitable for communicating with the computer user. Examples are
printers, video display terminals, keyboard etc.


2 Machine readable


Machine Readable devices are suitable for communicating with electronic equipment. Examples are
disk and tape drives, sensors, controllers and actuators.


2 Communication


Communication devices are suitable for communicating with remote devices. Examples are dig ital line
drivers and modems.
Following are the differences between I/O Devices


S.N. Criteria & Description


1 Data rate


There may be differences ofseveral orders ofmag nitude between the data transfer rates.


2 Application



Different devices have different use in the system.
3 Complexity of Control

A disk is much more complex whereas printer requires simple control interface.

4 Unit of transfer


Data may be transferred as a stream ofbytes or characters or in larg er blocks.


5 Data representation


Different data encoding schemes are used for different devices.


6 Error Conditions


The nature oferrors differs widely from one device to another.


Direct Memory Access (DMA)


Many computers avoid burdening the main CPU with prog rammed I/O by offloading some ofthis work to a
special purpose processor. This type ofprocessor is called, a Direct Memory Access(DMA) controller. A
special control unit is used to transfer block ofdata directly between an external device and the main memory,
without intervention by the processor. This approach is called Direct Memory Access(DMA).
DMA can be used with either polling or interrupt software. DMA is particularly useful on devices like disks,
where many bytes ofinformation can be transferred in sing le I/O operations. When used with an interrupt, the
CPU is notified only after the entire block ofdata has been transferred. For each byte or word transferred, it
must provide the memory address and all the bus sig nals controlling the data transfer. Interaction with a device
controller is manag ed throug h a device driver.
Handshaking is a process between the DMA controller and the device controller. It is performed via wires using
terms DMA request and DMA acknowledge.


Step Description

1 Device driver is instructed to transfer disk data to a buffer address X.
2 Device driver then instruct disk controller to transfer data to buffer.
3 Disk controller starts DMA transfer.
4 Disk controller sends each byte to DMA controller.
5 DMA controller transfers bytes to buffer, increases the memory address, decreases the counter C
until C becomes zero.
6 When C becomes zero, DMA interrupts CPU to sig nal transfer completion.


Device Controllers


A computer system contains a many types ofI/O devices and their respective controllers
network card
graphics adapter


Disk controller


DVD-ROM controller
serial port
USB
sound card
zubairsaif

Zubair saif

A passionate writer who loves to write on new technology and programming

Post A Comment:

0 comments: