What are the Various Techniques for Accessing a Device?
- Polling: In this instance, a CPU keeps an eye on the status of the device to share data. Busy-waiting is a drawback, but simplicity is a plus. In this scenario, when an input/output operation is needed, the computer simply keeps track of the I/O device’s status until it’s ready, at which time it is accessed. Stated differently, the computer waits for the device to be ready.
- Interrupt-Driven I/O: Notifying the associated driver of the device’s availability is the device controller’s job. One interrupt for each keyboard input results in slower data copying and movement for character devices, but the advantages include more effective use of CPU cycles. A block of bytes is created from a serial bit stream by a device controller. It also does error correction if needed. It consists of two primary parts: a data buffer that an operating system can read or write to, and device registers for communication with the CPU.
- DMA(Direct Memory Access) : Data motions are carried out by using a second controller. This approach has the benefit of not requiring the CPU to duplicate data, but it also has the drawback of preventing a process from accessing data that is in transit.
- Double Buffering: This mode of access has two buffers. One fills up while the other is utilised, and vice versa. In order to hide the line-by-line scanning from the viewer, this technique is frequently employed in animation and graphics.
Device Management in Operating System
The process of implementation, operation, and maintenance of a device by an operating system is called device management. When we use computers we will have various devices connected to our system like mouse, keyboard, scanner, printer, and pen drives. So all these are the devices and the operating system acts as an interface that allows the users to communicate with these devices. An operating system is responsible for successfully establishing the connection between these devices and the system. The operating system uses the concept of drivers to establish a connection between these devices with the system.