System/161 Installation

## Getting and Installing System/161

Note that if you are taking a course using System/161, chances are that your course staff has already installed it for you.

### Getting System/161

Download URLs:

> http://os161.eecs.harvard.edu/download/ (long-term address not yet operational)
> http://www.eecs.harvard.edu/~dholland/os161/download/ (current as of this writing)

### Supported Platforms

Actively maintained/tested host systems:

- Linux
- NetBSD
- Solaris

Other supported host systems:

- Digital Unix
- DragonflyBSD
- FreeBSD
- MacOS X
- OpenBSD

Other Unixes should work. You may need to use GNU make (or BSD make) on some. Windows is not supported; it might work with Cygwin or MinGW or the like, maybe. (I'll take noninvasive patches, but I won't maintain them.)

Supported host CPU types:

- any.

System/161 should be runnable on any remotely sane CPU and is known to be 64-bit clean.

Supported host compilers:

- gcc 4.0 through 4.8
- clang

gcc 4.9 might work or might require minor patches for a clean build. Older gcc probably still works. There also is explicit support for the DEC compiler for alpha on Digital Unix (aka Compaq Tru64) but it hasn't been tried in a long time. I have no data whatsoever on Sun's compilers.

Supported guest compilers:

- It should be possible (with some caution) to use any compiler that targets 32-bit MIPS CPUs.
- The processor regression tests use the OS/161 cross-compiler toolchain.

### Installation (Unix sysadmins and developers)

Short installation directions for Unix sysadmins: untar, `configure --help`, `configure`, `make`, `make install`. As of version 1.15 System/161 configures with `--prefix` and installs in the normal layout.

### Installation (everyone else)

Assuming you downloaded version 2.0, unpack the distribution file by typing

    	tar -xvzf sys161-2.0.tar.gz

This will create a subdirectory called `sys161-2.0` with the distribution files in it. Go into this directory by typing

    	cd sys161-2.0

and run the configure script. These are the configuration options:

| Option | Description | Default
--- | --- | --- | ---
`--with-compiler=CC` | Use CC as compiler | (probed)
`--prefix=DIR` | Install under DIR | `/usr/local`
`--bindir=DIR` | Install programs into DIR | PREFIX/bin
`--exampledir=DIR` | Install examples in DIR | PREFIX/share/examples/sys161
`--docdir=DIR` | Install docs into DIR | [PREFIX/share/doc/sys161
`--mandir=DIR` | Install man pages into DIR | PREFIX/man
`--devel` | Developer mode | off
`--debug` | Turn on debug symbols for sys161 itself | off

The configure script requires one additional argument: the processor type. For now there is only one processor supported, `mipseb`, so always supply that.

Thus to configure to install in your home directory you might do

    	./configure --prefix=$HOME/sys161 mipseb

Note that, because of the way the Unix shell handles ~, if you use `~/sys161` instead of `$HOME/sys161` it won't work. Now compile and install by typing

    	make

then

    	make install

If the compilation fails, please file a bug report.

If you get errors caused by make, such as

    	make: Missing separator

or

    	gcc: No input files

try using GNU make (or BSD make). There are a number of dialects of the old AT&T make around, and some of them do not work very well. Very old versions of BSD make may also have problems. This compiles and installs two versions of the simulator: `sys161`, the normal or "fast" simulator, `trace161`, which is the same as `sys161` but has lots of debugging and diagnostic support built in and thus doesn't run as quickly. It also installs three support programs: `hub161`, a tool for connecting multiple copies of System/161 together into a virtual network, `stat161`, a tool for printing the internal performance counters, and `disk161`, a tool for manipulating disk images. See below for more information.

### What's Installed

Assuming the default installation directories, and version 2.0, System/161 installs the following:

`/usr/local/bin/sys161-2.0`
  The fast version of the simulator.
`/usr/local/bin/trace161-2.0`
  A slower version of the simulator with tracing and profiling support.
`/usr/local/bin/stat161-2.0`
  A tool for monitoring the simulator.
`/usr/local/bin/hub161-2.0`
  A tool for linking multiple copies of System/161 together to form a virtual network.
`/usr/local/bin/disk161-2.0`
  A tool for manipulation disk images.
`/usr/local/bin/sys161`
  Symbolic link to the last installed sys161 version.
`/usr/local/bin/trace161`
  Symbolic link to the last installed trace161 version.
`/usr/local/bin/stat161`
  Symbolic link to the last installed stat161 version.
`/usr/local/bin/hub161`
  Symbolic link to the last installed hub161 version.
`/usr/local/bin/disk161`
  Symbolic link to the last installed disk161 version.
`/usr/local/share/examples/sys161/`
  Directory containing example config files.
`/usr/local/share/doc/sys161/`
  Directory containing this documentation.