CMSC 421: Principles of Operating Systems — Spring 2012 — UMBC—Project 2

Project 2

250 points

Due by 11:59pm on May 4, 2012.

In Project 2, you will create a new custom kernel by adding some new system calls to the 3.0.4 Linux Kernel, and write a small program to test these system calls.

If you are using VirtualBox, we would suggest taking a snapshot of the current state of your VM. This will help you quickly restore your VM to a previous state if you run into any problems with the kernel during your project.

Before you begin, create a custom kernel specific for Project 2 by creating a new working copy /usr/src/project2 of the kernel sources from the 3.0.4 vanilla linux kernel sources. Then update your /usr/src/linux symlink to point to /usr/src/project2.

Hereafter let $linux stand for the /usr/src/linux directory with the working copy of the kernel sources.

Name your custom kernel for Project 2 as 3.0.4-GLUSERNAME-cs421prj2, where GLUSERNAME is your UMBC GL username.

Ways to Lose Points before your project is even tested:

Part 1: Add the system calls to the kernel

You will add a few new system calls for managing mailboxes. Those mailboxes are to be used for asynchronous communication by processes in the system. The mailboxes and their contents all exist only in the Kernel address space. You will develop the system calls specified below in order to access the mailboxes and their contents by user processes.

You can make the following assumptions. There are at most 256 mailboxes, and each mailbox is identified by an unsigned (long) integer. Each mailbox can hold up to 128 messages which are to be retrieved in a FIFO order. The content of each message is a null-terminated string of at most 512 bytes (including the null).

The signature and semantics for your system calls must be:

Each system call returns an appropriate non-negative integer on success, and a negative integer on failure which indicative of the error that occurred.

Make sure that your system calls have exactly the same signatures as above, (since otherwise our test programs will fail, and thus your assignment as well!) Function/variable names are case sensitive (CASE does matter!!). In addition, you MUST keep the functions in the order above in the syscall table. Any kernel panics/failures will result in a very substantial reduction of points.

Part 2: User mode driver and test programs

Write two user mode driver programs (sendDriver and receiveDriver) to demonstrate that your system calls work correctly.

Note that you should use your own test program to test your system calls, to ensure that they work as specified and they can handle all kinds of (good and bad) inputs.

Hints & References

What to submit

You should submit the following items in a project2 directory in your Git repository:

It is important that you follow the guidelines for what to submit above, as well as the guidelines for assignments stated in the syllabus. Failure to do so may result in 0 points for the assignment.

Please be sure that ALL of the required files are in your repository before the due date and that you pushed them to the server using git push. No excuses will be accepted if the files are not on the server when the project is due! Please double-check that you have submitted the assignment properly (re-clone your repository to check it).