Project 6: Page Replacement with the Clock Algorithm

In this project you will extend your work on Project 5 to include page replacement, so MCryptFiles can be larger than the available physical memory. The goal of this project is to for you to learn about page replacement in general, and about the Clock Algorithm in particular.

Project Notes

Developing and Testing

To get started on this project, make a copy of your work for Project 5 by typing the following command in the parent directory of Project 5:

cp -r cs111_p5 cs111_p6

This will create a directory cs111_p6. Do your work for the project in this directory.

The directory also contains a Makefile; if you type make, it will compile your code along with a test program, creating an executable test. You can then invoke ./run_tests clock_tests, which will run a simple set of tests on your code. You can also invoke test with an argument specifying a particular test name; this will run a single test and print out its results. Invoke test with a bogus test name to print out all of the available test names.

As usual, we do not guarantee that the tests we have provided are exhaustive, so passing all of the tests is not necessarily sufficient to ensure a perfect score (CAs may discover other problems in reading through your code).

Submitting Your Work

To submit your solution, cd to the directory containing your work and invoke the command


If you discover problems or improvements after you have submitted, you may resubmit; only the latest submit will be graded.