Programmed I/O

From Computer History Wiki
Jump to: navigation, search

Programmed I/O refers to a style of I/O in which the transfer of data is performed by code running in the CPU, using instructions performed by the CPU to move data - as opposed to DMA, in which the device communicates directly with main memory.

There are two main types of Programmed I/O: i) polled, in which the CPU has to regularly check the device to see if it needs a data transfer, and ii) interrupt-driven, where the device causes an interrupt in the CPU when it needs to be serviced.

The former can have a fairly high level of overhead (the device must be constantly checked, whether it has anything to do or not), and also puts limits on the structure of the program. The latter can produce high levels of overhead when the device is running at high speed (due to the overhead involved in saving and restoring the context when an interrupt happens); as such, it is not well-suited to high-speed devices such as disks, which typically use DMA.

See also