Input/Output Hardware and Input/Output Controller
In this article, we understand about the Input/Output Hardware and Input/Output Controller in detail.
In order to manage and control the various I/O device attached to computer, I/O system requires some hardware and software components. I/O devices commonly use certain hardware devices. These are: system bus and ports.
Input/Output Controller is a component that attaches with each device and is used to accept input and provide output to these devices. Applications access I/O devices with the help of these I/O controllers. Thus I/O controller is a peripheral device that enables the main processor to transfer data between the host system and I/O devices. The I/O controller is a special purpose processor and are autonomous in nature. Autonomous means that I/O controllers carry out operations on I/O devices while the main CPU continues to execute programs.. The CPU controls the activities of an I/O controller by writing into and reading from I/O ports. I/0 controllers have certain registers to store data and control signals. These registers are:
Polling is a technique used by units such as CPU or a program to check the status of I/O devices. If the device is not in the required status, checking unit will continue with its work without waiting for the device to achieve required status Polling is also called busy-waiting because a device is busy in checking the status of other device. Polling is a common approach to handling multiple I/O device by expanding the busy-waiting loop of checking status. When a device is found with the desired status CPU branch the device with corresponding Interrupt Service Routine (ISR) so that interrupts produced by that device is handled by ISR. ISR, after performing an I/O operation, terminates. The device is again branched into the busy-waiting loop. Busy-wait loop ensures that CPU services each device as status of device is checking continuously.
Whenever a process needs to perform I/O it can use an interrupt. Interrupts stop the execution of a program to perform other tasks, such as numerical computation. Interrupt signal an event to occur. If an interrupt occurs, the CPU stores the current status of the process in the program registers and stop the program execution. CPU starts executing the interrupt. When CPU finishes its processing, it regains the status of process and continue its execution. I/O devices that halt the normal functioning of the processor generate various types of interrupts:
For each kind of interrupt, codes are written in operating system. These are called Interrupt Service Routine (ISR). It then decides the necessary steps that are taken when a particular interrupt occurs. Operating system handles interrupts in two manners: