Assignment 6, due Feb. 23

Part of the homework for CS:3620, Spring 2018
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

On all assignments, your name must be legible as it appears on your University ID card! Assignments are due at the start of class on the day indicated (usually Friday). Exceptions will be by advance arrangement unless there is what lawyers call "an act of God" (something outside your control). Homework must be turned in on paper, either in class or in the teaching assistant's mailbox. Never push late work under someone's door!

  1. Background: Consider a disk with 8 sectors per track. Without interleaving, the sequence of sector numbers going around the track would be 0-1-2-3-4-5-6-7.

    In a uniform interleaving, you use every i'th sector where the interval between successive sector numbers is a constant. The interleaving 0-2-4-6-1-3-5-7 is non-uniform because, while i=2 in most cases, the jump from 6 to 1 uses i=3 and the jump from 7 back to 0 uses i=1.

    The sequence given by i=1 is usually described as non-interleaved, but technically, it is the simplest uniform interleaving.

    a) List all of the uniform interleavings on 8 sectors, and for each, state the value of i. (0.5 points)

    b) Give a general rule. If the disk has s sectors per track, what values of i give distinct uniform interleavings. (There is a formally correct mathematical description of the required relationship between s and i.) (0.5 points)

  2. Background: Back in the days of Microsoft's DOS operating system, the system itself could not use more than 640K bytes of RAM. A typical system also had two 5 1/4 inch floppy drives. If you bought more memory than this, the system could not use it. However, some I/O drivers did use the extra memory. There were several alternative ways that drivers could use the extra memory:

    a) Which use of the extra RAM allowed both floppy disks to be used for user data once the system was up and running? (0.3 points)

    b) Which use of the extra RAM accelerated access to user files as well as system programs. (0.3 points)

    c) Which use of the extra RAM required extra effort when a floppy disk was ejected from its drive? Explain the problem. (0.4 points)

  3. Background: Some operating systems allow you to mount a file as a device, for example, Apple allows mounting disk image files (.dmg suffix). This primarily used as a software distribution mechanism, but it has a wide variety of potential uses. For example, after an old computer fails, it is sometimes possible to copy the disk image of that system into a file in the file system on a new computer and then extract and rescue content from the old file system that might otherwise have been lost. When a disk image file is mounted under an operating system, the directory structure stored on the mounted disk image becomes available on an equal footing with the directory structures of real disks mounted on that system.

    a) Where does the disk scheduler go? Specifically, is there any need for a disk scheduler for the mounted disk image? Briefly, why or why not? (0.5 points)

    b) What if the natural block size (the sector size) of my real disk differs from the natural block size of my mounted disk image file. Would this be easier to deal with using the Unix read() and write() kernel calls as a disk interface, or using the linearized sector number scheme outlined in the notes for Feb. 21? Briefly explain your answer. (0.5 points)