Quick Study Revision Points: I/O Operations and Device Management

Quick Study Revision Points: I/O Operations and Device Management

Table of contents

I/O Operations:

  1. Definition: Input/Output (I/O) operations involve the transfer of data between an I/O device and the main memory of a computer system.

  2. Purpose: I/O operations enable communication between the computer system and external devices, such as keyboards, monitors, disks, and network interfaces.

  3. I/O Devices: a. Block Devices: Data is transferred in fixed-size blocks, and each block is assigned an address. b. Character Devices: Data is transferred character by character, and no addressing is required. c. Network Devices: Enable communication between different systems over a network.

  4. I/O Techniques: a. Programmed I/O: The CPU directly controls the data transfer between an I/O device and memory. b. Interrupt-Driven I/O: I/O devices generate interrupts to notify the CPU when they are ready for data transfer or when an operation is complete. c. Direct Memory Access (DMA): A DMA controller transfers data between an I/O device and memory without CPU intervention. d. Memory-Mapped I/O: I/O devices are treated as memory locations, and data transfer occurs by reading from or writing to specific memory addresses.

  5. Buffering: Buffering involves temporarily storing data in buffers to improve I/O performance. a. Single Buffering: A single buffer is used to hold data during an I/O operation. b. Double Buffering: Two buffers are used, allowing data transfer and processing to occur simultaneously. c. Circular Buffering: A circular buffer allows continuous data flow between the I/O device and memory.

  6. Caching: Caching involves storing frequently accessed data in a faster memory to reduce I/O delays. a. Read Cache: Stores recently read data to satisfy subsequent read requests quickly. b. Write Cache: Temporarily stores write data to be written to the disk in larger chunks, improving disk write performance. c. Buffer Cache: Caches disk blocks to reduce disk I/O by satisfying read requests from the cache. d. Page Cache: Caches frequently accessed pages of virtual memory to reduce disk I/O.

  7. I/O Scheduling: I/O scheduling algorithms determine the order in which I/O requests are serviced to optimize performance. a. FCFS (First-Come, First-Served): Processes I/O requests in the order they arrive. b. SSTF (Shortest Seek Time First): Prioritizes I/O requests based on the shortest seek time to reduce disk arm movement. c. SCAN: Services I/O requests in one direction until the end of the disk, then reverses direction. d. C-SCAN (Circular SCAN): Similar to SCAN, but the disk arm moves in one direction and jumps to the beginning after reaching the end. e. LOOK: Services I/O requests in one direction until the last request in that direction, then reverses direction without reaching the end. f. C-LOOK (Circular LOOK): Similar to LOOK, but the disk arm moves in one direction and jumps to the beginning after reaching the last request.

  8. Device Management: a. Device Drivers: Software modules that interface with specific hardware devices and provide an interface for the operating system. b. Device Controllers: Hardware components responsible for managing and controlling I/O devices. c. Device Reservation: The ability to reserve a device exclusively for a particular process or user to prevent conflicts. d. Device Allocation: The process of allocating devices to processes based on device availability and access permissions. e. Error Handling: Techniques for detecting and handling errors during I/O operations, including error codes, interrupts, and error recovery mechanisms. f. Device Virtualization: Creating virtual instances of physical devices to share resources and provide isolation between processes.