Tips for NACHOS Assignment 2

NEW: Stuff that was going to be done in the lab Thursday, Oct. 2.

A rudimentary set of man pages has been made available for the set of system calls to be implemented in Assignment 2. Thanks to John Campbell and Peter Reissner (from the Winter 1995 class) for the intial draft of these man pages.

All of Assignment 2 can be done inside of the directories code/userprog and code/test.

Unlike Asssignment 1 the the clock is simulated in a much cleaner fashion. Because user code will be executed, the clock will advance one tick for each user instruction executed. You probably won't be needing the Alarm for future assignments, however, you should be able to reuse either some of what you've done or learned in implementing the Alarm to implement multiprogramming in this assignment. You can also get rid of the modifications I made available (the ones in new-code) if you like.

This really is one of those assignments where you are better off implementing little pieces at a time. In previous years too many groups have tried to do roughly everthing at once. The result is very hard to debug. I suggest at the very least you leave multiprogramming (time slicing) until the very end. This way you'll be able to trace through and debug any problems you have with your system calls without having to worry about the kernel switching Nachos processes on you. Also the rest of the assigments will go much more smoothly if you have a correct implementation of the system calls - without being able to time-slice than if you do a half debugged version of time-slicing.

A Possible Strategy

Before you Start

A Special Tip on Improving the File System Simulation

You are not required to do this but it may help to ensure that you don't encounter any nasty bugs in your implementation when moving to assignment 4.

Getting Started

Implement the System Calls

The system calls to be implemented are specified in code/userprog/syscall.h (Fork and Yield are optional and shouldn't be attempted until everything else is working).

NOTE: I recommend that you save time-slicing for last. It will make debugging your code much easier.

Test the System Calls

Implement the other Exception Handlers

Add Time-Slicing

Retest the System Calls

Things to Remember (Gotcha's)


Modified: Oct 11, 1995 Created: Oct 4, 1995