Difference between revisions of "Programmed I/O"

From Computer History Wiki
Jump to: navigation, search
m (+cat)
m (+See also - Direct Memory Access)
 
Line 1: Line 1:
'''Programmed I/O''' refers to a style of I/O in which the transfer of data is performed by code running in the [[Central Processing Unit|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]].
+
'''Programmed I/O''' refers to a style of I/O in which the transfer of data is performed by code running in the [[Central Processing Unit|CPU]], using [[instruction]]s performed by the CPU to move data - as opposed to [[Direct Memory Access|DMA]], in which the [[peripheral|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 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.
 
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.
 +
 +
==See also==
 +
 +
* [[Direct Memory Access]]
  
 
[[Category: Computer Basics]]
 
[[Category: Computer Basics]]

Latest revision as of 22:12, 20 October 2021

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