What is an interrupt-controlled I O.

Interrupt controlled I / O

Whenever a data transfer to or from the managed hardware could be delayed for any reason, the driver programmer should implement temporary storage. Data buffers help with the data transfer and receipt of the system calls read and write to decouple, and thus improve the overall performance of the system.

A good buffer mechanism uses “interrupt-controlled I / O”, in which an input buffer is filled at interrupt time and emptied by processes reading from the device. Accordingly, an output buffer is filled by the processes writing to the device and emptied at the interrupt time. An example for the interrupt-controlled output is the implementation of.

In order for the interrupt-controlled data transfer to work, the hardware must be able to generate interrupts with the following semantics:

  • The device interrupts the processor if new data has arrived and can be fetched by the system processor. How this happens depends on whether the device uses I / O ports, memory mapping or DMA.

  • When outputting, the device reports an interrupt if it is either able to receive new data or if it wants to confirm a successful transfer. Devices that can be mapped to memory or are DMA-capable usually generate interrupts to inform the system that they have finished with the buffer.

The relationships in timing between read or write on the one hand and the actual arrival of the data on the other hand were called in “the Section Blocking and non-blocking operations in Chapter 5 ”in Chapter 5. Interrupt-controlled I / O brings with it the additional problem that with concurrent access to shared data elements, race conditions can occur and synchronization mechanisms must therefore be provided. This related topic is discussed in more detail in the next section.