CMPSCI 377: Operating Systems
Homework 5: File Systems and I/O Systems
Due: December 7

VIP Students: Due one week from when you receive the assignment

  1. (10 pts) Problem 10.6 from OSC

    If arbitrarily long names could be used then it is possible to simulate a multi-level directory using a single level directory. This could be done, for instance, by using the character "/" to indicate the end of a sub-directory. The the file name "/usr/local/bin/netscape" indicates that netscape is a file in sub-directory bin, which is itself a sub-directory in local, and so on.

    If file name were restricted to seven characters, then it is difficult to simulate multi-level directories. The next best approach is such a situation would be to maintain a separate table that maps an arbitrary string to shorter seven character string.

  2. (5 pts) Problem 10.9 from OSC

    Printing a file requires the file to be accessed sequentially

    Binary search within a file containing employee payroll records results in random access.

  3. (10 pts) Problem 10.12 from OSC

    (a) Put the 4990 users in a group and set the access permissions for the group accordingly.

    (b) Create an access control list for the remaining ten users and deny all access privileges to this list for the file.

  4. (5 pts) Problem 11.4 from OSC

    Since memory is a volatile storage device, keeping the bit map of free blocks in memory would cause this information to be lost across OS crashes or reboots. Keeping this on mass storage (i.e., stable storage) ensures that this information is available across crashes.

  5. (10 pts) Problem 11.6 from OSC

    (i) Contiguous:
    (a) Let Z be the start location of the file. Divide the logical address by 512 and let X and Y denote the resulting quotient and the remainder respectively. Add X to Z to obtain the physical block number. Y is the offset into the block.
    (b) One block, since we can compute the address of the block and access it directly.

    (ii) Linked:
    (a) Divide the logical address by 512 and let X and Y denote the resulting quotient and the remainder respectively. Chase down X blocks in the linked list to get to the right physical block. Y is the offset into the block.
    (b) Four, since we need to start from block no. 1 and follow the linked list until we reach block 10.

    (iii) Indexed:
    (a) Divide the logical address by 512 and let X and Y denote the resulting quotient and the remainder respectively. Get the index block into memory. The address contained in the location X of the index block is the physical address of the desired block. Y is the offset into the block.
    (b) Two, one for the index block (assuming it is not already in memory) and one for the block.

  6. (10 pts) Problem 12.5 from OSC

    Polling is more efficient than interrupts when I/O is frequent and of short duration (Interrupts require a suspension and then resumption of the current process, which is more expensive. In situations where the amount of busy waiting is known to be less, polling is more efficient.) A terminal concentrator requires frequent and short (a character at a time) I/O. So a well-designed polling mechanism is more suitable for such a scenario.