chapter 11 - i/o management and disk scheduling Flashcards
categories of i/o devices
human readable device (printers, screens), machine readable (disk drives, sensors), communications (modems)
differences among i/o devices
Data rate: rate of data transfer.
Application: how the device is being used. Ex. disk drive for file storage or for swap space
Complexity of control: some devices are much more complex than others (disk more complex than printer).
Unit of transfer: one character at a time or blocks.
Data representation: data is represented different ways on different devices.
Error conditions: the kind of errors and their handling can be different among different devices.
techniques for performing i/o
Programmed I/O: CPU issues I/O and busy waits for it to complete.
Interrupt-driven I/O: CPU issues I/O and continues, is interrupted when I/O completes.
DMA: Direct memory access. CPU issues I/O and DMA module takes over, freeing the CPU.
what is DMA?
direct memory access
occurs when processor send command to the DMA module. DMA module performs data transfer without processor assistance. when completed, DMA module interrupts the processor
what information is in the command send to the DMA module?
Whether it wants to read or write
The address of the I/O device
The starting memory address to read or write to
The number of words to read or write
what are the OS design objectives for I/O?
efficiency and generality
what are the I/O layers?
logical layer, device layer, scheduling & control layer
what is the logical I/O layer?
provides simple high-level interface to user with generic commands like open, close, read, write.
what is the device I/O layer?
converts requested operations into appropriate sequences of I/O instructions.
what is the scheduling and control I/O layer?
low-level layer that interacts directly with the I/O module, including interrupts
what is I/O buffering? what problems does it solve?
lets the OS read/write data using buffers it owns, and managing the I/O to try to maximize efficiency (for example, by reading ahead).
the problems is solves are:
process can’t swap out and interferes with the OS, I/O is slow compared to the speed of the system
types of I/O devices?
block-oriented, stream-oriented
what are block oriented I/O devices?
Information is stored in fixed sized blocks.
Transfers are made a block at a time.
Used for disks and tapes.
what are stream-oriented I/O devices?
Transfers information as a stream of bytes (no block structure).
Used for terminals, printers, communication ports, mouse, and most other devices that are not secondary storage.
what is a single buffer (i/o management)?
Operating system assigns a buffer in main memory for an I/O request.
Transfers made to buffer.
Buffer copied to user space when needed.
Next unit is read into the buffer (read ahead, in anticipation of next request).
block oriented: holds a block
stream oriented: byte of data or an entire line of data