11 Flashcards
How does an I/O device communicate with the CPU?
Through hardware registers available in a device controller
What are the five hardware registers in a device controller and what are their functions?
Opcode registers: hold code of operation to be performed, e.g., read or write
Operand registers: hold parameters associated with the operation, e.g., addresses to be red or written at, DMA parameters, etc.
Busy AND Status registers: provide information about availability, readiness, errors
Data Buffer registers: hold bytes transferred to or from the I/O device, e.g., value typed in on the keyboard, or text to be printed
What is Method 1 for accessing the device controller?
What is an advantage of Method 1 (special I/O instructions)?
What is a disadvantage of Method 1 (special I/O instructions)?
The CPU instruction set is extended with special I/O instructions like io_store and io_load.
It avoids interference with virtual memory since no physical address is associated with registers.
Devices cannot be mapped in user space, so users cannot directly access the device as a normal data structure.
What is Method 2 for accessing the device controller?
What is an advantage of Method 2 (physical address space extension)?
What is a disadvantage of Method 2 (physical address space extension)?
Physical address space is extended to directly refer to device registers, giving each register a physical address.
The device can be mapped to the user space, allowing easier interaction via virtual addresses.
It complicates virtual memory management, increasing system complexity.
What is the issue with different I/O device controllers?
Why is the lack of uniformity among I/O controllers a problem?
Each device may have a different set of registers, opcodes, and operands, requiring specific code for each controller.
It limits portability, increases work, and raises the risk of bugs when changing device types or brands.
What is the I/O subsystem in an operating system?
What are the main goals of the I/O subsystem?
How does the I/O subsystem optimize performance?
It is the part of the OS that manages input and output devices
Presenting a logical/abstract view of I/O devices.
Facilitating the sharing of devices.
Providing efficiency and optimizing performance.
Ensures the CPU and multiple I/O devices run in parallel.
Reorders I/O requests to improve throughput.
Uses buffering to hide latency.
What are some design concerns for the I/O subsystem?
Large variety of I/O device types (e.g., keyboards, displays, printers, etc.).
Different speeds and brand-specific approaches for devices.
Supporting the addition of new devices after OS development and installation.
What are the two levels of abstraction in I/O systems?
High-level I/O abstraction
Low-level I/O abstraction
What is the focus of high-level I/O abstraction?
Give examples of tasks handled by high-level I/O abstraction.
Provides generic code for handling classes or families of I/O devices.
High-level operations to read or write data on disk or CD-ROM.
Implementation of network protocols, such as TCP.
What is the role of low-level I/O abstraction?
How does low-level I/O abstraction interact with devices?
Encapsulates brand-specific device issues with well-defined low-level operations (e.g., read, write, open, close).
A device driver implements low-level operations for each specific device.
What is the role of device drivers in low-level I/O abstraction?
Are device drivers software or hardware?
Device drivers implement the specific operations needed for each hardware device.
Software programs
What are three classes of I/O Devices?
Block-oriented/Storage Devices
Stream-oritented Devices
Network Communication Devices
What are the primary uses of block-oriented I/O devices?
Examples
Reading and writing blocks of data in arbitrary order
hard drive, ssd, CD reader, magnetic tape
What are primary uses of stream-oriented I/O Devices?
Examples
input and output data in a SEQUENTIAL way
keyboards, sensors, actuators, mouses
What are the primary uses of network communication devices?
Sending and receiving packets on a network socket interface
providing connection and communication protocols