difference between Interrupt Driven I/O and DMA mode
Interrupt driven I/O:
Direct Memory Access(DMA) means CPU grants I/O module authority to read
from or write to memory without investment.
The previous way of I/O suffer from two inherent drawbacks.
a) The I/O transfer rate is limited by the speed with which the processor can
test and service a device.
b) The processor is tied up in managing an I/O transfer;a number of
instructions must be executed for each I/O transfer.
when large volumes of data are to be moved ,a more efficient technique is requird:Direct memory access.The DMA function can be performed by a seperate module on the system bus,or it can be incorporated into an I/O module .in either case ,the technique works as follows.
When the processor wishes to read or write a block of data,it issues a command to the DMA module by sending the following information.
1.whether a read or write is requested.
2.the address of the I/O devices.
3.starting location in memory to read from or write to.
4.the number of words to be read or written.
the processor then continues with other work .it has delegated this I/O operation to the DMA module,and that module will take care of it.The DMa module transfers the entire block of data ,one word at time,directly to or from memory,without going through the processor .when the transfer is complete ,the DMA module sends an interrupt signal to the processor .thus the processor is involved only at the beginning and at the end of the transfer.
in programmed I/O CPUtakes care of whether the device is ready or not.data may be lost.whereas in the interrupt-driven I/O,device itself inform the CPU by generating an interrupt signal.if the data rate of the I/O is too fast.data may be lost .in this case CPU mostly be cut off ,since CPU is too slow for the particular device .the initial state is too fast .it is meaningful to allow the device to put the data directly to the memory.This is called DMA.DMAcontroller will take over the task of CPU.CPU is general purpose but the DMA controller is specific purpose.
A DMA module controls the exchange of data between main memory and I/O module.the processor sends a request for the transfer of a block of data to the DMA module module and is interrupted only after the entire block has been transferred.