CSC369: Week 11 Practical

Week 11 Practical: A3 Infrastructure

Assignment 3 asks you to build a set of programs that manipulate virtual disks. In this lab, you'll be writing some basic functions that you'll need to complete A3.

Here is the virtual disk image we will be using today. It contains a few directories (A, B, and C) and empty text files. I recommend that you open it up and compare it to the emptydisk image from last week.

Your goal is, in the language of your choice, to write two functions:

  1. Given an open file that contains a virtual disk and a valid inode number on that disk, print the address of the inode on the disk and the address of the first data block that contains the file associated with the specified inode.
  2. Given an open file that contains a virtual disk, print the contents (names and inode numbers) of the root directory.

What's the benefit to you? These functions will be useful as you implement the assignment. Also, the cleanest (according to Andrei and I) implementation of each function that we receive will (a) be posted on the assignment handout as shared infrastructure for the class and (b) earn its author(s) a 1 point bonus on the assignment. (Yes, you may work in a team of two.)

This is your exercise for the day, so by the end of the day, please email me (Andrew) your submission. If you are unable to complete one or both of the required functions, instead of sending me code, send me a single line of text that explains what issue you've run into or question that you need answered in order to make progress. If you worked on a team, please cc your team member on the email sent to me. (Please only send one email per team.)