CSCI 3323 (Principles of Operating Systems), Fall 2015:
Homework 4

Credit:
20 points.

Reading

Be sure you have read (or at least skimmed) Chapter 4.

Problems

Answer the following questions. You may write out your answers by hand or using a word processor or other program, but please submit hard copy, either in class or in one of my mailboxes (outside my office or in the ASO).

  1. (5 points) Consider a digital camera that records photographs in some non-volatile storage medium (e.g., flash memory). Photographs are recorded in sequence until the medium is full; at that point, the photographs are transferred to a hard disk and the camera's storage is cleared. If you were implementing a file system for the camera's storage, what strategy would you use for file allocation (contiguous, linked-list, etc.) and why? Notice that this camera does not have the ability to delete photographs from its storage one at a time, so your file system does not need to support that. (It's probably best to think of this as a somewhat hypothetical problem, using only the description supplied, rather than trying to extrapolate from your experience with actual cameras.)

  2. (5 points) The textbook describes more than one strategy for keeping track of free blocks in a file system (free blocks, bitmaps, and FATs). All of these strategies rely on information that is kept both on disk and in memory, sometimes with the most-current information only in memory. What would happen if the copy on disk of whatever data structure is used to keep track of free blocks was lost or damaged because of a system crash -- is there a way to recover, or do you have to just reformat the disk and hope you backed up any really important files? Answer separately for MS-DOS FAT-16 (which uses a FAT) and UNIX V7 filesystems (which use one of the other strategies).

  3. (10 points) Consider a UNIX filesystem (as described in section 4.5.3) in which each i-node contains 10 direct entries, one single-indirect entry, one double-indirect entry, and one triple-indirect entry. If a block is 1KB (1024 bytes) and a disk addresses is 4 bytes, what is the maximum file size, in KB? (Hint: Use the blocksize and size of disk addresses to determine how many entries each indirect block contain.)



Berna Massingill
2015-11-24