nachos.kernel.userprog.test
Class ProgTest

java.lang.Object
  extended by nachos.kernel.userprog.test.ProgTest
All Implemented Interfaces:
java.lang.Runnable

public class ProgTest
extends java.lang.Object
implements java.lang.Runnable

This is a test class for demonstrating that Nachos can load a user program and execute it.


Field Summary
private  java.lang.String execName
          The name of the program to execute.
 
Constructor Summary
ProgTest(java.lang.String filename)
          Start the test by creating a new address space and user thread, then arranging for the new thread to begin executing the run() method of this class.
 
Method Summary
 void run()
          Entry point for the thread created to run the user program.
static void start(java.lang.String[] args)
          Entry point for the test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

execName

private java.lang.String execName
The name of the program to execute.

Constructor Detail

ProgTest

public ProgTest(java.lang.String filename)
Start the test by creating a new address space and user thread, then arranging for the new thread to begin executing the run() method of this class.

Parameters:
filename - The name of the program to execute.
Method Detail

run

public void run()
Entry point for the thread created to run the user program. The specified executable file is used to initialize the address space for the current thread. Once this has been done, Machine.run() is called to transfer control to user mode.

Specified by:
run in interface java.lang.Runnable

start

public static void start(java.lang.String[] args)
Entry point for the test. Command line arguments are checked for the name of the program to execute, then the test is started by creating a new ProgTest object.

Parameters:
args - Command line arguments that name the program to be executed.