Running Nachos on Linux

For marking purposes, your code will be compiled and executed in the CSCF undergraduate environment. You are responsible for ensuring that your code runs there.
Getting Nachos running on your Linux PC should be relatively painless. However, this is not a guarantee - there are too many flavours of PCs and Linux out there. Getting Nachos running on the CSCF machines is our responsibility. Getting Nachos running on your machine is yours. The course newsgroup may be a good place to turn if you are stuck.

I [Prof. Salem] have built and run Nachos on Linux 2.0.18 with only minor changes required. Changes may be required when you build - hopefully they will be minor as well. You are encouraged to post your building experience to the course newsgroup, so that others can benefit from it.

Jan 03 update: I was able to build Nachos on a 2.4 Linux kernel - no Nachos changes required. Just download and unpack the tar file and "make depend", "make" in build.linux. coff2noff also built with no changes except a minor, self-explanatory edit at the end of coff2noff/Makefile.dep.)

To build and run Nachos, you should need only a copy of the Nachos source (assuming that you already have GNU Make and g++ installed on your machine). To copy Nachos to your Linux machine, just copy the file nachos.tar.gz from the home directory of the course account (~cs350/common/nachos.tar.gz). Alternatively, you can save this link to your local disk. Unzip and untar Nachos into any directory you'd like. Once you have done this, build Nachos in the directory code/build.linux, following the instructions in the Makefile there. You should probably read the general Nachos installation instructions first, if you have not already done so.

To build the Nachos test programs, you will need two additional things: a cross-compiler and the coff2noff program. The source for the coff2noff program is included in the nachos.tar.gz file you downloaded. Look at Makefile and especially Makefile.dep in the coff2noff directory for some hints on how to make coff2noff for Linux. The cross-compiler is necessary to compile the test programs to run on the simulated Nachos MIPS processor. It is not strictly necessary that you be able to build the test programs at home. You should be able to cross-compile on the CSCF machines, and then transfer the test program executables to your Linux machine to run on your copy of Nachos. However, if you would like to be able to build the test programs on your own machine, you will need the cross-compiler.

A tar file containing the binaries for a Linux version of gcc, configured to cross-compile to MIPS, is provided for you at ~cs350/public_html/common/linux-gcc.tar.gz in the CSCF environment. Unpack this on your local disk. You will need to edit the Makefile in the code/test directory to include the proper pathname for the cross-compiler on your machine.

If the previous tar file doesn't work on your Linux, try the following version provided by your fellow student: ~cs350/public_html/common/nachos-cc-binaries.tar.gz.

Note: as of September 1999 it seems that this gcc code must be extracted to /usr/local/nachos because the version of gcc there has some paths coded to look for the pre-processor in subdirectoris of /usr/local/nachos. In code/test/Makefile.dep you need to set up some information. On my system here is what it looks like. -- TBB

In case you wish to build the gcc cross-compiler yourself, you may be interested in how the build of linux-gcc.tgz was done.

Once you've got coff2noff and a cross-compiler, you will need to edit the Makefile.dep file in code/test to compile the test programs. Check the comments at the end of Makefile.dep for some hints on how to do this.