CS6210: Advanced Operating Systems
Fall 2008
Project 4
Home Logistics Assignments Reading Lectures

Project 4: Recoverable Virtual Memory

Introduction

In this project you will implement a recoverable virtual memory system like the ones described in the LRVM and Rio Vista papers. Users of your library can create persistent segments of memory and then access them in a sequence of transactions.

You may work in groups of two.

Making the memory persistent is simple: simply mirror each segment of memory to a backing file on disk. The difficult part is implementing transactions. If the client crashes, or if the client explicitly requests an abort, then the memory should be returned to the state it was in before the transaction started.

To implement a recoverable virtual memory system you should use one or more log files. Before writing changes directly to the backing file, you can first write the intended changes to a log file. Then, if the program crashes, it is possible to read the log and see what changes were in progress.

More information is available in the above-mentioned papers. It is up to you how many log files to use and what specific information to write to them.

The API

You should make a static library named librvm.a and a header file named rvm.h. If you don't know how to make a static library, man ar and look at the 'r', 's', and 'v' flags. Your library must implement the following functions exactly:

Test Cases

In order to get a feel for how the above API is used, you should write some test cases that use the above functions and check whether they worked correctly. To implement your test cases, you will probably want to use multiple processes, started either with fork() or by starting programs from a shell script. You may also want to simulate crashes within the program; the exit() and abort() functions are useful for this.

Each test case should print out either "OK" or "ERROR"; if it prints "ERROR" then it should give some description of what went wrong.

I won't grade your test cases, but you are very likely to have fewer bugs in your program the more tests you write. Thus more tests have an indirect effect of increasing your score.

Here are some (but not all) tests the TA will use:

Submission