CS 39 -- Project 3


Clean-up

For this project, you will use a new and improved version of the simulated CPU. The update is a simple one, meant to address a design flaw in the previous CPU.

The change is an introduction of two memory fault registers (MFRs). Upon any faulty memory access, the MMU will place all needed information into these registers instead of into the general registers. Thus, we avoid the problem of interrupts that clobber values in user-addressable registers. Specifically:

You can access the MFRs from the kernel using two new functions in the CPU's interface. Specifically:


The SEND and RECV system calls

We want the kernel to provide FIFO buffers so that processes can communicate. Specifically, we will allow processes to send values to one another through a pair of system calls:


Your assignment

You can obtain the code for the new virtual machine by unpacking the tarball available in my public directory:

tar -xjvpf ~sfkaplan/public/cs39/VP-v1.3.tar.bz2

Again, the tarball does not include a kernel -- it's just the machine itself. You will have to adapt your kernel from the last assignment for this one.

You must do the following:

  1. Ensure that virtual memory works: Remedy the problems remaining from project 2. Make sure that mapping and swapping are performed correctly.

  2. Implement the SEND and RECV system calls: A process should request these system calls by placing 0x1111000a or 0x1111000b, respectively, in register %s0.

  3. Write a test program: Write a program that forks once. After forking, the parent should send messages to the child. Specifically, the parent should sent the values from 1 to 100. The child, upon receiving these values, should sum them, and that sum should be its result code. Be sure to test this program with a large interrupt period to see that the blocking is performed correctly on a full/empty FIFO buffer.


Submitting your work

When your group has completed its project, submit all files as project-3 using the cs39-submit program. Note that this program can take directory names as arguments.


This assignment is due on Thursday, November 13th at 11:59 pm!

Scott F. Kaplan
Last modified: Mon Nov 3 16:49:04 EST 2003