nachos.machine
Class Machine

java.lang.Object
  extended by nachos.machine.Machine

public final class Machine
extends Object

The master class of the simulated machine. Processes command line arguments, constructs all simulated hardware devices, and starts the grader.


Method Summary
static AutoGrader autoGrader()
          Return the autograder.
static ElevatorBank bank()
          Return the hardware elevator bank.
static SerialConsole console()
          Return the hardware console.
static String[] getCommandLineArguments()
          Return an array containing all command line arguments.
static String getProcessClassName()
          Return the name of the process class that the kernel should use.
static String getShellProgramName()
          Return the name of the shell program that a user-programming kernel must run.
static void halt()
          Print stats, and terminate Nachos.
static Interrupt interrupt()
          Return the hardware interrupt manager.
static void main(String[] args)
          Nachos main entry point.
static NetworkLink networkLink()
          Return the network link.
static Processor processor()
          Return the MIPS processor.
static FileSystem stubFileSystem()
          Return the stub filesystem.
static void terminate()
          Terminate Nachos.
static void terminate(Throwable e)
          Terminate Nachos as the result of an unhandled exception or error.
static Timer timer()
          Return the hardware timer.
static void yield()
          Yield to non-Nachos threads.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(String[] args)
Nachos main entry point.

Parameters:
args - the command line arguments.

yield

public static void yield()
Yield to non-Nachos threads. Use in non-preemptive JVM's to give non-Nachos threads a chance to run.


terminate

public static void terminate()
Terminate Nachos. Same as TCB.die().


terminate

public static void terminate(Throwable e)
Terminate Nachos as the result of an unhandled exception or error.

Parameters:
e - the exception or error.

halt

public static void halt()
Print stats, and terminate Nachos.


getCommandLineArguments

public static String[] getCommandLineArguments()
Return an array containing all command line arguments.

Returns:
the command line arguments passed to Nachos.

interrupt

public static Interrupt interrupt()
Return the hardware interrupt manager.

Returns:
the hardware interrupt manager.

timer

public static Timer timer()
Return the hardware timer.

Returns:
the hardware timer.

bank

public static ElevatorBank bank()
Return the hardware elevator bank.

Returns:
the hardware elevator bank, or null if it is not present.

processor

public static Processor processor()
Return the MIPS processor.

Returns:
the MIPS processor, or null if it is not present.

console

public static SerialConsole console()
Return the hardware console.

Returns:
the hardware console, or null if it is not present.

stubFileSystem

public static FileSystem stubFileSystem()
Return the stub filesystem.

Returns:
the stub file system, or null if it is not present.

networkLink

public static NetworkLink networkLink()
Return the network link.

Returns:
the network link, or null if it is not present.

autoGrader

public static AutoGrader autoGrader()
Return the autograder.

Returns:
the autograder.

getShellProgramName

public static String getShellProgramName()
Return the name of the shell program that a user-programming kernel must run. Make sure UserKernel.run() always uses this method to decide which program to run.

Returns:
the name of the shell program to run.

getProcessClassName

public static String getProcessClassName()
Return the name of the process class that the kernel should use. In the multi-programming project, returns nachos.userprog.UserProcess. In the VM project, returns nachos.vm.VMProcess. In the networking project, returns nachos.network.NetProcess.

Returns:
the name of the process class that the kernel should use.
See Also:
UserKernel.run(), UserProcess, VMProcess, NetProcess