Difference between revisions of "Programmed I/O"
(A decentr start) |
(Tweak def) |
||
Line 1: | Line 1: | ||
− | '''Programmed I/O''' refers to a style of I/O which is performed by code running in the [[CPU]] - as opposed to [[Direct Memory Access]], in which the device communicates directly with [[main memory]]. | + | '''Programmed I/O''' refers to a style of I/O which is performed by code running in the [[CPU]], using instructions performed by the CPU to move data - as opposed to [[Direct Memory Access]], 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. | 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 puts limits on the structure of the program. The latter can produce high levels of overhead when the device is running (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 | + | 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 [[disk]]s, which typically use DMA. |
Revision as of 18:23, 4 June 2017
Programmed I/O refers to a style of I/O which is performed by code running in the CPU, using instructions performed by the CPU to move data - as opposed to Direct Memory Access, 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.