Interrupt Driven v/s DMA


#1

difference between Interrupt Driven I/O and DMA mode


#2

Interrupt driven I/O:

  1. Interruot driven I/O means CPU issues commands to the I/Omodule then
    proceeds with its normal work until interrupted by I/O device on completion of its
    work.
  2. The problem with the programmed I/O is that the processor has to wait a long
    time for the input/output module of concern to be ready for either reception or
    transmission of data.
  3. The processor,while waiting,must repeatedly interrogate the status of the
    input/output module. As a result the level of performance of entire system is
    degraded.
  4. An alternative approach for this is interrupt driven input/output.the processor
    issue an input/output command to a module and then go on to do some other
    useful work.The input/output module will then interrupt the processor to
    request service ,when it is ready to exchange the data with the processor.
  5. The processor then executes the data transferas before and then resumes its
    former processing.
  6. Interrupt -driven input/output still consumes a lot of time because every data has to pass with processor.

DMA:

  1. Direct Memory Access(DMA) means CPU grants I/O module authority to read
    from or write to memory without investment.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.