Assignment 6, due Feb. 27

Part of the homework for 22C:112, Spring 2009
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

  1. Background: Look up CD-ROM, CD-R and CD-RW technologies on the web. Wikipedia is a useful source.

    a) (0.5 points) What is the maximum and average rotational latency of CD-ROM drives operating at 32x speed.

    8x is 4000 RPM, so 32x is 16000 RPM. This is 266 rev/sec, or .00375 sec/rev. The maximum rotational latency is therefore 3.75 milliseconds, and the average should be about half this, or 1.875 milliseconds.

    b) (0.5 points) Explain the most prominent reasons that CD-RW drives do not compete with magnetic disks of the same capacity and similar rotational speed.

    First, seek times (that is, head movement latency) are very slow on CD-ROM compared with hard magnetic disk drives. Second, for high-speed CD-ROM drives, erase-and-then-rewrite speed is frequently significantly slower than read speed, and any change in disk speed are very slow because disks have high angular momentum.

  2. Background: In older systems, there was only one processor, so all computation involving disk management was done by the operating system.

    In modern systems, since the development of the SCSI interface, it has been common to include a microprocessor or microcontroller as part of the disk drive itself, the disk-local processor. This processor runs a fixed program from ROM provided by the disk vendor. Of course, a significant part of this processor's job is to handle the protocol on the bus connecting the disk to the main system, but it can also take care of hardware specific details while leaving higher level issues to the operating system.

    a) (0.5 points) Give specific examples of functions that the disk-local processor can handle, and examples of functions that are best handled by the operating system.

    Caching of recently read or written sectors, scheduling of write operations for recently written sectors of the cache.

    b) (0.5 points) Discuss some of the potential pitfalls of this separation of function between the operating system and the disk-local processor.

    The following three examples are all good answers. Nobody was expected to get all of them.

    If there is data in the drive's local cache that has not yet been written to disk, the user may not know this and power down the disk, leading to loss of this information.

    Putting the cache and scheduling functions in the drive instead of the operating system forces traffic between the drive and the host computer that could be avoided if the cache were closer to the application.

    Hiding the physical organization of the disk from the storage allocation mechanisms in the file system reduces the opportunity for performance gains that result from careful allocation of disk space.

  3. Background: During the late 1980's, IBM PC models became available with far more memory than Microsoft's DOS operating system could use. Some applications simply bypassed the system and directly used the extra memory, if it was available. One popular application was called a RAM-Disk. This appeared, from the operating system's perspective, to be a disk driver, while it used RAM and not any physical disk. It was frequently useful to copy heavily used files to RAM disk on startup, particularly for those who were using floppy disks as their primary disk drives. Recall that most floppy disks were only about one megabyte in capacity.

    A disk cache is a more sophisticated way of using the extra RAM. In this case, the disk cache software looks like a disk drive to the operating system, and it, in turn, sits on top of a real disk drive. Accessing that drive through the cache improves performance for access to recently used sectors.

    a) (0.5 points) What can you do with a RAM disk that you cannot do with a disk cache.

    Copy your disk to RAM disk, then dismount it from the drive and use that drive for something else. This is particularly valuable if you have only one drive.

    b) (0.5 points) What does a disk cache do automatically that a user of a RAM disk would have to do by hand before shutting down the system.

    If you use a disk cache, copies from cache to disk are automatic after each write operaiton. With RAM disk, in contrast, you have to explicitly copy the RAM disk back to your physical disk before shutting down the system.