General purpose computers need to be able to access a variety of IO devices, from long term storage, mouse, keyboard, networking, and more.
A device controller/adapter is an electronic circuit capable of operating a specific I/O device. The interface may be set by and/or examined by device drivers.
A device driver is a device-specific program that implements I/O operations, requested by user applications or the OS, by interacting with the device controller.
As technology increases the numbers and types of IO devices increases to include audio and video devices, bio-metric scanners, and more. To be able to incorporate new devices into a system without modifications to the OS, the I/O system supports a small set of generic API (application programming interface) instructions. Drivers must then extend and implement one of these IO based APIs. This means it is the hardware developers responsibility to write device drivers for their products, not the OS developer.
The typical subdivision includes instructions for:
- Block-oriented devices (magnetic disks, CD ROMs, FLASH disks)
- Character-oriented devices (keyboards, pointing devices, cameras, media players, printers) USB – (Universal Serial Bus) connectors means that all of the data is sent one byte at a type (serially).
- Network devices (modems, Ethernet adapters)
Polling
Programmed I/O is a style of I/O programming where the CPU, running the device driver, performs the copying of all data between the I/O device controller and main memory.
Polling is used to determine whether a device is busy or idle by reading a flag set and reset by the device controller.
Interrupts
When interrupts are used for I/O processing, the interface to the controller remains the same, but the controller can issue interrupts to the CPU. This stops what is happening, and allows the device to transfer data.
Direct Memory Access
Often referred to as DMA -a hardware component that allows devices to access main memory directly, without the involvement of the CPU. Not does as much anymore since memory can be used differently each time a process runs.
Poling and Interrupts both have overhead associated with them. Poling tends to be better for single process computers and quick data transfer such as with solid state devices.
The Hardware-Software Interface was originally found on Access 2 Learn