
Learn through the super-clean Baeldung Pro experience:
>> Membership and Baeldung Pro.
No ads, dark-mode and 6 months free of IntelliJ Idea Ultimate to start with.
Last updated: August 11, 2022
In this tutorial, we’ll explore the basic structure of an operating system’s I/O subsystem, we’ll look at the principles and complexities of I/O hardware, and explain some aspects of I/O hardware and software.
Actually, I/O management is one of the most important components of operating system design. There are many reasons for that:
We use ports, device controllers, and buses to connect to different types of devices. While connecting them, device drivers enable the encapsulation of device details.
There are an enormous number of types of I/O devices such as storage, transmission devices, and human-interface peripherals.
The below figure shows the typical peripheral component (PC) bus structure:
In order to understand how these devices work, let’s look at the common concepts first.
Resource contention problem is one of the main problems in computing. Dijkstra illustrates this situation by proposing different kinds of problems. So, we may have more than one I/O device demanding any particular bus, in that case, bus contention can occur.
The bus contention issue can be resolved by a method known as bus arbitration. The bus arbiter or bus controller maintains this operation. There are three main methods to solve the bus contention problem with the help of a bus controller. These are daisy chaining, polling, and independent requesting.
I/O devices can be mainly divided into 4 categories:
As we see in the figure above, there are some controllers that work like an interface between a device and its driver. Device drivers are software modules that plug into an OS to manage a particular part. I/O units generally contain a mechanical component and an electronic component. We call electronic components the device controller.
There should always be a device controller and a driver for each I/O device in order to communicate with the operating system. Otherwise, the I/O device doesn’t work as expected. For example, before Windows 10 OS, we’d have to manually install almost all of the drivers when we re-install the OS. With Windows 10, we get rid of such a problem but OS takes care of this issue for us in the background.
A device controller can manage multiple devices. Its main purpose is to convert serial bit stream to block of bytes and perform error correction.
So far, we’ve talked about wide-ranging devices. These devices operate at different data transfer speeds and have different interfaces. For instance, the keyboard and mouse have similar data rates and are asynchronous in data transfer to the computer.
If we choose to deal with all these parties on the CPU, it can be overwhelming for the performance of the system. This is where I/O controllers take to the stage and resolve this issue. They are like bridges between CPU, memory, and I/O devices.
Also, different equipment may require different interfaces and I/O controllers also make it possible. They also act as a buffer during data transfer.
In this article, we’ve gone through the principles of I/O hardware and explained some key points. It is doubtless that I/O management is one of the key issues in operating systems.