CS 1651: Advanced Operating Systems

Programming Assignment #3: Virtual Block Device

Due Date: Friday, March 19, 2004, 3pm

Description

For this assignment you will implement a virtual block device, with the intent of lying about the underlying device.You will also implement a small test application to demonstrate your virtual device. You are to implement this pseudo-device using your operating system of choice, but you will need to make it as flexible as possible (as you will build upon this for a later assignment) ... so I strongly recommend implementation as a loadable kernel module rather than rebuilding the kernel with each revision. For linux, start with a look at loadable kernel modules, and for BSD I'd suggest looking at "ccd," but I leave it up to you as to where you choose to create the device (though the requests you pass through should go to a raw interface ... though I realize that doesn't always mean you've bypassed the cache :) For simplicity during development, consider the use of a loopback device to use a file as the underlying block device.

The pseduo device must satisfy the following main requirement:

The Test Application

To test your pseudo-device you will need to run a program that reads and writes blocks of data. Specifically, you should write two programs, one that sequentially reads all the blocks on the device, and another that reads them in an alternating pattern. Let's say your device is N blocks in capacity, then the first program will take N as a command line parameter. The second program will take an additional parameter K, and will read all blocks in the following order:

0, N/K, 2N/K, 3N/K, .... (K-1)N/K, 1, 1+2N/KY, 1+3N/K, ... etc.

You'll notice that this is a very bad sequence of block requests for most block devices, (how bad may depend on the choice of K).

Testing & Results Presentation

Testing will include two parts

What to submit?

You must submit your source code (your new kernel files, your applications, etc) and a readme file explaining your design decisions and detailed instructions for testing. You will be required to make appointments to demostrate your system.

You should also submit the graphs you plotted based on timing the test applications (line graphs are suggested for this purpose).