CS 377: Operating Systems - Gettings Started with Nachos
UMass Computer Science, Fall 2012 [Course homepage]
Several of our programming projects will be using the Java version of the Nachos instructional operating system. Although Java may
seem an odd choice, both the (outdated) C version of Nachos and the Java version focus on OS concepts; they are rather equivalent at a high-level.
The Nachos system includes several projects - we will only be using a few parts of them, so do not worry too much about the specifics of 'proj1', 'proj2', etc. within the Nachos systems.
You need to 1) install Nachos, and 2) get the MIPS cross-compiler running.
Installing Nachos
Nachos on Linux/Mac OS/Windows+Cygwin:
- Download the Nachos source files:
$ wget http://lass.cs.umass.edu/~shenoy/courses/377/discussions/nachos/nachos-umass.tar.gz
- Unzip and untar the source:
$ tar xzvf nachos-umass.tar.gz
- This command will create a directory called nachos/ containing the source files.
- As a test, type the following commands to compile the Nachos Project 1:
$ cd nachos/proj1
$ make
$ ../bin/nachos
- Now Nachos should be running with Nachos Project 1. You can follow the same procedure for project 2, etc.
Nachos on Eclipse:
If you want to use Eclipse, this example will show you how to set up Nachos Project 1 in Eclipse.
- Extract the nachos tar into a new folder (referred to as cs377, you can name it whatever you want). E.g., the extracted Nachos directory should be cs377/nachos.
- In eclipse: New Java Project.
- Uncheck "Use default location"
- Browse for the "cs377" folder and select it. IMPORTANT: Do NOT select the nachos folder itself. This way the package structure is preserved.
- Click Finish.
- In Eclipse, use the package explorer to browse to nachos/machine/Machine.java.
- Run it (You will get an error saying: "Error loading nachos.conf")
- Click the drop down run menu and select "Run Configurations", Give your run configuration a name (Project1 for example)
- Go to the arguments tab and select "Other" for your working directory.
- Click on "Workspace" and browse for nachos/proj1 (The entry should look like "${workspace_loc:nachos/nachos/proj1}").
- Click Run.
Installing the MIPS cross-compiler
Follow the instructions here to get the cross-compiler running.
Additional Resources