CSE 120 Nachos Project

Fall 2002
  1. Nachos
  2. Projects
  3. Documentation
  4. Distributions
  5. Compiling
  6. Assistance
  7. Cheating


Nachos is a popular instructional operating system for undergraduate OS classes. It has been used for many years at many universities. It is a challenging system to learn, but is also as rewarding as it is challenging.

Nachos may seem complex (because it is) and confusing at first, but after using the system for a while you will become familiar and comfortable with it. There are also some advantages with using such a well-established project. First, it has been thoroughly debugged and is therefore relatively stable. Second, there is extensive documentation describing the Nachos system. Both of these points should make it easier for you to learn and use Nachos.

There are two versions of Nachos in current use, Nachos 3.4 and Nachos 4.0. They both have the same functionality. Nachos 4.0 is an updated version of 3.4, has been more widely ported, and is perhaps better architected from a software engineering point of view. However, most of the detailed guides describing the Nachos system refer to Nachos 3.4. Because of this reason, we will be using Nachos 3.4.


Tom Anderson originally developed Nachos for a semester-long course at U.C. Berkeley that involved five projects. When he moved to the University of Washington, he adapted the original Nachos project outline to a quarter-long course involving three projects: (1) Threads, (2) Multiprogramming, and (3) Virtual Memory. It is this outline that we will be following for our projects this quarter.


There are many resouces for using and learning the Nachos system. Essential are the original Nachos paper and the Nachos Road Map by Thomas Narten, but you will probably find it useful to browse the other resources as well (such as the Working With Nachos pages at Duke University).


The platform we will officially support is the Sparc/Solaris cluster of machines in the uAPE lab. We have customized the generic Nachos distribution for the CSE 120 class, so you should use the version of Nachos that we make available (i.e., do not download from other sites on the Web). The Nachos distribution file can be accessed via the following path:

Or you can download it from the class Web site:

To copy, unpack, and compile the distribution, do the following in your class account:

% cp ~/../public/cse120-nachos.tar.gz .

Note: Compiling Nachos requires some environment variables to be set. When you log in to your class account, if you were prompted to "prep" a class, be sure and select "cs120f". If you were not prompted, you can run prep from the command line:

% prep cs120f
Once you have copied the distribution, do the following:
% gunzip -c -d cse120-nachos.tar.gz | tar xvf -
% cd nachos-3.4/code
% gmake
% cd threads
% ./nachos

Note that the "-" at the end of the gunzip/tar command line is separated from the "xvf" by a space (it means "read from stdin"); if you don't have that space, the command will not work properly. After unpacking the distribution, it will create and populate the directory "nachos-3.4".

Using Nachos on other systems

Nachos has been developed to run on almost any operating system, but it requires the installation of a MIPS cross-compiler (so that you can compile C code that you write into MIPS executables independently of the architecture that you run the compiler on). We have installed a MIPS cross-compiler on the uAPE systems for class use, so on the class machines you do not have to worry about it.

You are welcome (and encouraged) to download Nachos to any system that you want. However, we cannot make any guarantees that it will compile on your system, although we can try to help if you run into difficulties. Furthermore, since generating a MIPS cross-compiler can be an involved task, if you do use Nachos on another system you will still probably want to use the cross-compilers that we have used:

Nachos Configuration

If you are curious about how to configure Nachos for a particular system, there are three Makefiles that we have changed:

In the Nachos distribution for CSE 120, we have changed the Makefiles to refer to environment variables. These environment variables are set in a prepfile script location in ~/../public/prepfile.


To compile Nachos, cd into the code subdirectory and run gmake. This will compile all files in all subdirectories. Note, however, that each project will be concentrated in one subdirectory at a time (e.g., Project 1 will be done in the threads subdirectory). After you have compiled all subdirectories, you can just run gmake from within one of the subdirectories to recompile the version of nachos created in that directory.


The Nachos projects are aggressive, complex, and time-consuming. Nachos may seem overwhelming at first, but the projects are not impossible. If your group is spending many hours stuck on a single problem, then you should seek assistance. Be sure and read the various support documents. Come to office hours. And use the class discussion board to share problems and tips.


Cheating is not an acceptable method for completing your projects. The consequences of cheating will correspond to the severity (e.g., failure of the assignment, failure of the course). The academic honesty guidelines outlined by Charles Elkan for CSE 130 apply to this course.

I urge you to resist any temptation to cheat, both on the projects as well as the homeworks and exams, no matter how desperate the situation may seem. If you are in circumstances that you feel compel you to cheat, come to me first before you do so.