UNIVERSITY OF WISCONSIN-MADISON
Computer Sciences Department
CS 537
Spring 2000
A. Arpaci-Dusseau
Quiz #9: Wednesday, April 26

Name: Student ID #:

File Systems

Problem 1: Disk Characteristics (40 points)

Consider a disk with the following characteristics: a) How many platters does this disk have?

The top and bottom surface of a platter is usually not active in a disk (i.e., there is no disk arm). Therefore, there are probably 9 platters in this disk.

Credit will also be given for saying there are 8 platters.

b) How many sectors per track?

You need to know the relationship between tracks and cylinders to answer this problem: there is one track on each surface in each cylinder. Since there are 4096 sectors/cylinder and there are 16 surfaces, there are:

  4096 sectors      1 cylinder
  ------------  *  ------------  = 2^12 / 2^4 = 2^8 = 256 sectors/track
   1 cylinder       16 tracks

c) What is the total size (i.e., capacity) of this disk? For full credit, please show your work.

4096 sectors    2048 cylinders      512 bytes
------------ *                   * ------------  = 2^32 bytes = 4 GB
 1 cylinder                           sector

Problem 2: Open Files (60 points)

Consider two independent processes A and B that have just started executing along with per-process and system open file tables with the following initial contents:
Open Tables
a) Each of the following pieces of data must be kept in either the per-process open file table or the system open file table. Determine which of the two locations is most appropriate for each piece of information. (Hint: This isn't a memorization question. You should be able to reason through each case.) b) Modify the diagram to show the final state of all tables after the following system calls have executed. Show the names of the file assigned to each table entry and the pointers from the per-process table to the system table. Include the reference count in the appropriate table(s). Assume that process A and B have the same current working directory and that all system calls complete successfully.
    Process B: fd1 = open("x", mode);
    Process A: fd1 = open("y", mode);
    Process B: fd2 = open("y", mode);
    Process A: close(stdin);
    Process A: fd3 = open("z", mode);
The diagram will look like the following:
Open Tables