Lab 8 - Disks and File Systems
Due: 9:55 AM, Thursday, April 28, 2005


This week's lab consists of practice questions to look at on your own (not to be turned in) and questions to be submitted. Your answers should be submitted in a PDF file lab8.pdf.

Practice Questions

Lab Questions

Prepare written answers to the following questions and include them in your submitted PDF file.

  1. SG&G 11.2 (2 points)
  2. SG&G 12.2 (2 points)
  3. SG&G 12.7 (2 points)
  4. Is disk scheduling, other than FCFS, useful in a single-user environment? Explain briefly. (2 point)
  5. Suppose the first part of a Unix file is stored in the same disk block as its inode. Is this an improvement over the usual approach? (1 point)
  6. Read the handout about the UNIX buffer cache from The Design of the UNIX Operating System (Bach, 1986, Prentice-Hall). Describe in a few paragraphs the main goals of the buffer cache and how they are accomplished. Take a look at the FreeBSD source code that implements the buffer cache, in /sys/kern/vfs_bio.c on any lab FreeBSD system, and include a few paragraphs describing the FreeBSD implementation. (4 points)
  7. Look at the man page for readdir(). Use the system calls shown there, write a simple C program called "ls2" that operates only on the current directory. Print as much interesting information about each file as you can. Turn this in as a file ls2.c. (2 points)