Running Nachos on Mac OS X (PPC)


CAVEAT NUMBER 1:
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.
CAVEAT NUMBER 2:
The patch was submitted by a student and has been tested on PPC Mac OS X only. Mileage may vary on Intel Macs and on Mac OS 9.

To build and run Nachos on Mac OS X, you should need a copy of the NachOS source and the Mac OS patch available here. You will also need a reasonably recent version of the Mac OS X binutils (provided with Xcode). First, place the patch file in your Nachos root directory. The contents of that directory should look similar to the following:

COPYRIGHT  c++example  code  coff2noff osx_ppc.patch
From the root directory of your Nachos copy, run the following commands:
$ patch -p0 < osx_ppc.patch
$ cd code/build.osx_ppc
$ ln -s ../build.solaris/Makefile Makefile
$ make depend
$ make
(optional) $ ./nachos -K # this will run the nachos thread test; the output should be correct.

For information on how to build the test programs, refer to the instructions for building Nachos on Linux here.

You will likely have to add something like the following to the Makefile.dep for coff2noff:

# If Mac OS X
ifeq ($(osname),Darwin)
hosttype = x86Darwin
# PPC Macs are big-endian.  Intel macs are little-endian.
ifeq ($(shell uname -p), powerpc)
HOSTCFLAGS = -DHOST_IS_BIG_ENDIAN
endif
endif