From chapter 5 of text book
Problem 1:
The model in fig 5.1 shows a controller with two devices. This shares controller for many devices (of same/similar type) and eliminates the need for controller per device. If controllers become cheap (free) then controller can be built into the device itself. With controller per device, multiple transfers can be in parallel giving better I/O performance.
Problem 2:
Possibly useful. Files are stored in logically adjacent sectors and with sector interleaving, a program can process file data from a sector so that when the next request from the program comes in, the disk head would be positioned for no rotational delay. Of course, this depends on the type of program and whether the processing behavior is uniform.
Problem 3:
Rotation time is 200 msec. Reading all sectors require 1/2 rotation for sector 0 and 2.75 rotations to get the data (data reading finishes when sector 7 is read). Thus 3.25 rotations which take 650 msec are needed. 4k in 650 msec works out to 6302 bytes/sec. No interleaving takes 300 msec to read 4k which is 13653 bytes/sec.
Problem 4:
Each line produces 1200x7 = 8400 samples/sec. At 5.7 microsec per sample, each line takes 8400x5.7 = 47.88 msec of DM-11 time. 20 lines would take 957.6 msec of DM-11 time per second of real time which works to 96% busy and 4% idle for the DM-11.
Problem 5:
Packet copying (4 times) takes 4.1 msec
Two interrupts take 2.0 msec
transmission time 0.83 msec
Total of 6.93 msec for 1024 bytes.
Max data rate is 147,763 bytes per sec which is about 12% of 10
Mbps network capacity. With protocol overheads, the figure will be even
worse.
Problem 6:
Files and devices are accessed the same way, that is, by the same set of calls. Systems which have one set of calls for writing a file and another for writing, say, console or terminal do not support device independence
Problem 7:
(a) device driver (b) device-independent software (c) device driver (d) device independent software (e) user-level software
Problem 8:
A process could tie up a printer for long as it computes the lines to be printed in spells with gaps.
Problem 9:
(a) 10+12+2+8+18+34+32 - 146 cyls - 876 msec
(b) 0+2+12+4+4+36+2 - 60 cyls - 360 msec
(c) 0+2+16+2+30+4+4 - 58 cyls - 348 msec
Problem 10:
A unix program that reads 10000 blocks from disk issues one request at a time and blocks before issuing the next request. The disk device driver sees only one request at a time and has no opportunity to schedule disk reads but to do them in order of arrival. Starting many processes to read blocks will exhibit the elevator algorithm performance.
Problem 12:
2 msec x 60 per sec = 120 msec per sec = 12%
Problem 13:
When a character is written to an RS232 terminal, it takes long time (relatively) to print. Waiting would be wasteful. So interrupts are used. With memory mapped terminals, the character is accepted fast and hence interrupts do not make sense.
Problem 14:
At 110 baud, we have 10 interrupts per sec which takes 40 msec or 4% of cpu. At 4800 baud, we have 480 interrupts per sec which takes 1920 msec. It is not possible and can not be done. The system can handle at most 250 interrupts per sec.
Problem 15:
Scrolling a window needs copying 65x80 = 5200 chars. copying a char (12x8 pixels = 12 bytes) takes 6 microsec. Whole window takes 31.2 msec. Writing 80 chars to screen takes 4 msec and so, scroll and display of a new line of 80 chars takes 35.2 msec - 2273 chars/sec (22.7 kbaud). For color, everything is four times as long, and so, we get 5683 baud.
Problem 16:
Escape characters are provide different effects by the driver such as back space, cursor positioning.
Problem 17:
The microprocessor inside the terminal can move lines by copying characters. For speed, special hardware will be required and is provided on more expensive terminals.
Problem 18:
25 lines of 80 chars each, each 8 pixels high requires 200 scan lines to be drawn. At 60 screens per sec, we have 12000 scans/sec. At 63.6 microsec/scan, the beam is moving horizontally 763 msec in each second, leaving 237 msec for writing video RAM (23.7% of the time).