UC Santa Cruz CMP 111
Nachos Project Structure

Arguments and Options for Nachos

Braden Carter / Jim Spring

Command-Line Options

Command-line options for Nachos are organized on a per-assignment basis. You are highly encouraged to introduce new options.

Those options that may be used by for all assignments and their descriptions include

    -d causes certain debugging messages to be printed (cf. utility.h)
    -rs causes Yield to occur at random (but repeatable) spots
    -z prints the copyright message

Nachos does not come with any options for either the Threads assignment or the Virtual Memory assignment. Either would be a good place to start implementing your own options.

For the Multiprogramming assignment, where USER_PROGRAM is defined, options and their descriptions are

    -s causes user programs to be executed in single-step mode
    -x runs a user program
    -c tests the console
For the Filesystems assignment, where FILESYS is defined, options and their descriptions are
    -f causes the physical disk to be formatted
    -cp copies a file from UNIX to Nachos
    -p prints a Nachos file to stdout
    -r removes a Nachos file from the file system
    -l lists the contents of the Nachos directory
    -D prints the contents of the entire file system 
    -t tests the performance of the Nachos file system
For the Networking assignment, where NETWORK is defined, options and their descriptions are
    -n sets the network reliability
    -m sets this machine's host id (needed for the network)
    -o runs a simple test of the Nachos network software

Introducing New Options

Command-line arguments to Nachos are parsed in two different locations, namely the function main() in main.cc, and the function Initialize() in system.cc.

Options implemented in Initialize() typically pertain to configuring the actual "machine". This would include issues like whether or not you support a console.

Options implemented in main() typically pertain to a particular assignment, such as testing Threads or system calls.


Usage Syntax

The following usage information was taken from main.cc.

       Usage: nachos -d <debugflags> -rs <random seed #>
              -s -x <nachos file> -c <consoleIn> <consoleOut>
              -f -cp <unix file> <nachos file>
              -p <nachos file> -r <nachos file> -l -D -t
              -n <network reliability> -m <machine id>
              -o <other machine id> -z

bwcarter@cse.ucsc.edu / jims@cse.ucsc.edu

Last Modified 1996/04/18 02:31:07.