The three categories of I/O device.
Human readable, machine readable, communications.
Give examples of machine-readable devices.
Disk drives, USB keys, sensors, controllers, actuators — used to communicate with electronic equipment.
What are communication devices used for? Examples?
To communicate with remote devices — digital line drivers, modems.
Six areas in which I/O devices differ.
Data rate, application, complexity of control, unit of transfer, data representation, error conditions.
Unit of transfer: terminal I/O vs disk I/O.
Terminal I/O: a stream of bytes or characters. Disk I/O: larger blocks.
How can the application affect the handling of a disk?
A disk storing files requires file management software; a disk storing virtual memory pages needs special hardware and software to support it.
Programmed I/O vs interrupt-driven I/O (Table 11.1).
Both transfer I/O-to-memory through the processor; programmed I/O uses no interrupts, interrupt-driven I/O uses interrupts.
Which technique does a direct I/O-to-memory transfer?
Direct memory access (DMA), with the use of interrupts.
What does the I/O-bus DMA configuration reduce?
The number of I/O interfaces in the DMA module.
Why does swapping not fully solve the I/O efficiency problem?
Swapping is used to bring in ready processes, but swapping is an I/O operation itself.
Hierarchical design: how do layers relate?
Each layer relies on the next lower layer for more primitive functions and provides services to the next higher layer; changes in one layer should not require changes in others.
Why must certain pages remain in main memory during I/O?
To avoid deadlock.
Access time is the sum of which two times?
Seek time (position the head at the desired track) + rotational delay (beginning of the sector reaches the head).
Define rotational delay (rotational latency).
The time it takes for the beginning of the sector to reach the head.
FIFO disk scheduling: two properties.
Fair to all processes; approaches random scheduling in performance if there are many processes.
Why is priority disk scheduling a poor policy for database systems?
Its goal is not to optimize disk use but to meet other objectives, and longer jobs may have to wait an excessively long time.
LIFO disk scheduling: good for what, and what is its risk?
Good for transaction processing systems (little arm movement); possibility of starvation since a job may never regain the head of the line.
How does SSTF choose the next request?
The request that requires the least movement of the disk arm from its current position (minimum seek time).
SCAN vs C-SCAN.
SCAN moves in one direction serving requests, then reverses. C-SCAN serves in one direction only; at the end, the arm returns to the opposite end and the scan begins again.
What is N-step-SCAN?
It segments the disk request queue into subqueues of length N, processed one at a time using SCAN; new requests are added to another queue.
What is FSCAN?
Two subqueues: new requests go into the other (empty) queue, and their service is deferred until all old requests have been processed.
Head starts at track 100; requests 55, 58, 39, 18, 90, 160, 150, 38, 184. Average seek length for FIFO, SSTF, SCAN and C-SCAN?
FIFO 55.3; SSTF 27.5; SCAN 27.8; C-SCAN 35.8.