Chapter 7, Device Management, Ida A. Flynn and Ann McIver McHoes, Understanding Operating Systems, Second Edition, PWS Publishing Company (1993)
Lesson A: System Devices, Sequential Access Storage Media, Direct Access Storage Devices, Fixed-Head Drums and Disks, Movable-Head Drums and Disks, Optical Disk Storage, Access Time Required, Access Time for Fixed-Head Disks, Access Time for Movable-Head Devices
Problem 1. What is the difference between buffering and blocking?
Buffering is the use of intermediate storage areas for temporary storage of data transiting between devices (which includes main memory).
Blocking is act of grouping of one or more logical records into a physical record. Deblocking is the act of parsing a physical record into one or more logical records.
Problem 2. Given the following characteristics for a magnetic tape:
D = Density | 1600 bits / inch per track |
S = Speed | 200 inches / second |
L = Length | 2400 feet |
H = Start/ Stop (Halt) Time | 3 milliseconds |
R = Number of records to be stored | 200,000 records |
A = Logical Record Size | 160 bytes |
B = Block Size | 10 logical records |
G = Inter-Block Gap | 0.5 inch |
Since there are 8 data tracks, 1600 bits per inch per track gives us 1600 bytes per inch across all data tracks. The linear density is 1600 bpi. The area density is 1600 bytes per inch for data. There is an additional track at 1600 bits per inch for a parity bit.
Find the following:
U = # bytes per inch = D * (8 tracks) * (1 byte / 8 bits) = 1600 bytes / inch
J = # of inches of tape used per block = E / U = 1 inch / block
F = H + (J/S) + H
F = H(start) + (J/S) + H(stop) = 3 ms + 5 ms + 3 ms = 11 ms
The tape is not long enough.
Problem 3. Given the following characteristics for a disk pack with 10 platters yielding 18 recordable surfaces:
T = period of revolution | = 10 ms / rev |
S = seek rate | = 0.1 ms / track |
R = track density | = 19,000 bytes / track |
N = number of records | = 200,000 records |
L = length of record | = 160 bytes / record |
B = block size | = 10 records / block |
A = tracks per surface | = 500 tracks / surface |
C = number of surfaces | = 18 surfaces |
The statement of this problem was flawed. It was deleted from the required list. With some modifications, it is still a good problem.
A number like 10 ms is a measure of time. It can be a period of revolution. It is not a speed. Speed is velocity, which has units of measure of length / time for linear velocity or angle / time for radial velocity. Computer scientists, physicists, engineers, and psychologists all use the same standard units of measure. You can find the legal English Language translation of the SI units of measure (written in French) at the web site for NIST. See http://physics.nist.gov/cuu/Units/units.html at the National Institute of Standards and Technology (formerly, National Bureau of Standards).
We are not told details of how the disk is formatted. In particular, we do not know the number of bytes per sector and number of sectors per track.
Find the following:
Problem 6. Would a drum be a better device than a disk when paging is used? Why or why not?
Our text does not give enough information to make a decision. Answer: Use a disk. Except in copiers, drums went out with punched cards, paper and metalic tape, and dinosaurs. I was not able to find reference to drums on the internet except at computer history sites. I also was not able to find a reference to bubble memory.
The real question should be to select between fixed and movable head secondary storage. In a paging system, speed of secondary storage access is a key in a paging device.
The answer is to use a fixed head device with a fast rotational speed. The fixed head disk does not have to wait for the mechanical positioning of the read/ write head over the track, which is the huge time consumer on a disk drive with a movable head read/ write arm. The tradeoff is that you cannot get the read heads as close together as you can create tracks on a disk. You can compensate by having multiple sets of fixed read head arms that are offset, for a price (of course). The moveable head disk drive merely adjusts the position of the head.
Look for people exploring applications of magnetoelectronic memories as they enter the marketplace in 2001 from Honeywell Corp. See IEEE Spectrum, FEB 2000 and http://www.spectrum.ieee.org Cost will certainly be a determining factor of what applications this technology will be used in.
Problem 8. You are given a file of ten records (identified as A, B, C, ..., J) to be stored on a disk that holds ten records per track. Once the file is stored, the records will be accessed sequentially: A, B, C, ..., J. It takes 2 ms to process [P] each record once it has been transferred into memory. It takes 10 ms for the disk to complete one rotation, and therefore 1 ms to rotate for one record [r]. It takes 1 ms to transfer [T] the record from the disk to main memory. Suppose you store the records in the order given: A, B, C, ..., J.
Compute how long it will take to process all ten records. Break you computation into:
I changed "drum" to "disk". (Hardware failure; couldn't find replacement parts.) Assume that the records are already stored on the disk. This is inconsistent with the first sentence of the problem, but consistent with the questions. We are not told whether the logical records are stored in individual sectors on a single disk track or blocked as one collective physical record. Assume the worst case that our buffer holds only one record at a time, and we only have one buffer. Assume the program does not ask for one record until it has completed processing the previous record. Assume the disk read head is position over the first record when the problem starts.
Record Number | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Record Contents | A | B | C | D | E | F | G | H | I | J |
T | P | P | r | r | r | r | r | r | r | |
r | T | P | P | r | r | r | r | r | r | |
r | r | T | P | P | r | r | r | r | r | |
r | r | r | T | P | P | r | r | r | r | |
r | r | r | r | T | P | P | r | r | r | |
r | r | r | r | r | T | P | P | r | r | |
r | r | r | r | r | r | T | P | P | r | |
r | r | r | r | r | r | r | T | P | P | |
r | r | r | r | r | r | r | r | T | P | |
P | r | r | r | r | r | r | r | r | T | |
P | P |
a. In the worst case, the system does not request a subsequent record until it completes processing of the current record. The disk continues to rotate, and is past the subsequent record when ready to request its input. The disk must complete its rotation to reposition for transmitting the subsequent record. Each block above represents 1 ms of time. From the start of reading one record until the start of reading the subsequent record is 11 ms. From the start of reading the last record until the last record has completed processing is 3 ms. The total time from starting to read the first record until the tenth record has completed processing is 102 ms.
b. In the best case, read the whole track into a buffer all at once and deblock from the buffer as you need records. With this strategy, the total time from starting to read the first record until the tenth record has completed processing is 30 ms.
Problem 9. Given the same situation described in Problem 8:
Record Number | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Record Contents | A | H | E | B | I | F | C | J | G | D |
T | P | P | T | P | P | T | P | P | T | |
P | P | T | P | P | T | P | P | T | P | |
P | T | P | P | T | P | P | T | P | P |
The total time is 30 ms.
Break you computation into:
If you have 3 processors, you can overlap the work. The total time is 12 ms.
TIME | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
Proc 1 | TA | PA | PA | TD | PD | PD | TG | PG | PG | TJ | PJ | PJ |
Proc 2 | TB | PB | PB | TE | PE | PE | TH | PH | PH | |||
Proc 3 | TC | PC | PC | TF | PF | PF | TI | PI | PI |