Distributions
The platform we will officially support is the Sparc/Solaris
cluster of machines in the EBU3B B230. 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:
- ~/../public/cse120-nachos.tar.gz
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 EBU3B B230 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:
- HOST and LDFLAGS in code/Makefile.dep
- GCCDIR in code/test/Makefile (location of the cross compiler)
- CLFAGS in code/bin/Makefile
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.
Compiling
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.