Discuss I/O Hardware in Operating System?

Handling various I/O devices, such as a mouse, keyboard, touchpad, disc drives, monitor adapters, USB devices, bit-mapped screens, LEDs, analog-to-digital converters, on/off switches, connections, audio I/O, printers, etc., is a crucial function of an operating system. An I/O system is required to send an application’s I/O request to the physical device, receive any response from the device, and then send that response back to the application.

I/O devices can be split into two groups:

  1. Block devices − One block device the driver communicates with by sending whole blocks of data. Hard disk, USB cameras, disk-on-key, etc., for example.
  2. Character devices − A character system is one that communicates with the driver by sending and receiving single characters (bytes, octets). Such as serial ports, parallel ports, sound cards, etc.

Device Controllers

Device drivers are software modules that can be plugged into an operating system to manage a specified device. Operating System is supported by device drivers in managing all I/O devices.

The Application Controller functions like a system-driver interface. Usually, I/O devices (keyboard, mouse, printer, etc.) consist of a mechanical component and an electronic component where the system controller is considered an electronic component.

Synchronous vs asynchronous I/O

  1. Synchronous I/O − CPU execution waits in this scheme as I/O goes
  2. Asynchronous I/O − I/O runs at the same time as CPU execution

Direct Memory Access (DMA)

Direct Memory Access (DMA) means that CPU grants authority to read from or write to memory without involvement in the I / O module. DMA module manages data sharing between main memory and I / O device itself. Only at the beginning and end of the transfer is CPU involved and interrupted after the whole block has been moved.

Polling I/O

Polling is the easiest way to communicate with the processor via an I/O device. The process of checking the device’s status periodically to see if it is time for the next I / O task, is called polling. The I / O system simply puts the information in a status log, and the processor has to come in and get the details.

Interrupts I/O

The interrupt-driven approach is an alternative scheme for handling I/O. An interrupt is a signal coming from a device requiring attention to the microprocessor. A system controller places an interrupt signal on the bus when it needs the attention of the CPU when it receives an interrupt, saves its current state and invokes the necessary interrupt handler using the interrupt vector