Homework 12 (the very last)

22C:116, Fall 1999

Due Friday Dec 3, 1999, in class

Douglas W. Jones

  1. Background: Under Unix systems (including Linux), the directory /dev contains entries for each physical device in the system. If you have two hard disk drives, for example, they would normally have names such as /dev/hda and /dev/hdb. Typically, these are protected so only the superuser can access them, and normally, they are accessed only through the file system and not directly. Nonetheless, a user with root privileges can open, for example, /dev/hdb and directly read or write the system's second hard drive.

    Assume there that reading or writing /dev/hdb will do no damage because no file system has been created on this secondary drive. Furthermore, the drive interface may advertise a structure on disk, in terms of tracks, sectors, and whatnot, that differs from the physical organization of the actual disk. These differences allow drives to conform to industry standard organizations despite a wide variety of actual internal layouts, and these differences are possible because the disk controller that is part of the drive has its own CPU, executing code from ROM and organizing its data in its own RAM.

    Note that modern drives frequently include a RAM cache as part of the controller function, and that, in addition, UNIX systems maintain a cache of recently accessed disk sectors.

    The Assignment: Outline a series of experiments that you could incorporate into a program to determine the following characteristics of /dev/hdb, assuming that it is correctly attached to your system, including the correct configuration of the I/O driver for access to this disk:

    Note that some of these may be very hard or impossible, or that, while some of these may be hard to measure individually, their sum or product may be measurable.

  2. Background The multithreaded process model of Amoeba, combined with the synchronous RPC model of interprocess communication, requires a server model somewhat different from that we discussed earlier in the semester.

    Part A What prevents the following model from being used in Amoeba? Your answer should cite chapter and verse in the text.

       server:
          semaphore pop initialized to X
          loop
             wait(pop)
             await RPC from client
             create a thread to serve one request
              | do processing for RPC
              | finish RPC
              | signal(pop)
              | end of created thread
          endloop
    

    Part B How would you rewrite the above pseudocode to make a useful skeleton for an Amoeba server. Your new skeleton should preserve the server's ability to handle multiple client requests concurrently.

  3. A Problem There are several similarities between the use of capabilities in Amoeba and Demos. List the major differences between the ways these two systems use capabilities.