Installing and Building Nachos

You will develop, test, and demo your code on Solaris SPARC machines (Sun workstations) in the acpub domain. The Nachos resource page on the course web includes an HTML source code browser and instructions for a full installation of the Nachos release we will use this semester.

Install your Nachos copy into a directory of your choice on acpub. Wherever it goes, please give us read access to it with the following AFS incantation: fs setacl mydirectory chase:cps110 rl . Do this first! The Nachos resource page has links to complete instructions on AFS access control. AFS is flexible enough to allow you to give write access to the members of your group, read access to us, and no access to anyone else. We must have access to your code in order to give you credit for each assignment.

The Nachos code directory includes several subdirectories with source code for different pieces of the Nachos system. The subdirectories include Makefiles that allow you to automatically build the right components for specific assignments using the gmake command. The relevant subdirectories are threads for Labs 1-3, userprog for Labs 4-5, and vm for Labs 6-7. If you type gmake in one of these directories, it will execute a sequence of commands to compile and link Nachos, yielding an executable program called nachos in that directory. All of your testing will be done by running these nachos executables built from your modified Nachos code.

You should study the Makefiles to understand how dependency identification and recompilation work. The dependency information determines which .cc files are rebuilt when a given .h file changes. The dependency lines in each subdirectory Makefile (e.g., nachos/threads/Makefile) are created automatically using the gmake depend facility. For example, if you type cd threads; gmake depend , this will regenerate the dependency information in the threads/Makefile . It is extremely important to keep your dependency information up to date.

A few simple guidelines wil help you avoid build problems, which can consume hours of frustrating debugging time tracking bugs that do not really exist. First, always be sure that you run gmake depend any time the header file dependencies change (e.g., you introduce a new .cc file or include new header files in an existing .cc file), or any time the location of the source code changes (e.g., you cp or mv the source tree from one directory to another). Second, always make sure you are running the right copy of the nachos executable, presumably one you just built. If in doubt, change directories to the correct directory, and execute Nachos with ./nachos .