nachos.ag
Class AutoGrader

java.lang.Object
  |
  +--nachos.ag.AutoGrader

public class AutoGrader
extends Object

The default autograder. Loads the kernel, and then tests it using Kernel.selfTest().


Constructor Summary
AutoGrader()
          Allocate a new autograder.
 
Method Summary
 boolean exceptionHandler(Privilege privilege)
          Notify the autograder that a user program executed a syscall instruction was executed.
 void finishingCurrentThread()
          Notify the autograder that the current thread has finished.
 void readyThread(KThread thread)
          Notify the autograder that the specified thread has moved to the ready state.
 void runningThread(KThread thread)
          Notify the autograder that the specified thread is now running.
 void setIdleThread(KThread idleThread)
          Notify the autograder that the specified thread is the idle thread.
 void start(Privilege privilege, String[] args)
          Start this autograder.
 void timerInterrupt(Privilege privilege, long time)
          Notify the autograder that a timer interrupt occurred and was handled by software if a timer interrupt handler was installed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoGrader

public AutoGrader()
Allocate a new autograder.
Method Detail

start

public void start(Privilege privilege,
                  String[] args)
Start this autograder. Extract the -# arguments, call init(), load and initialize the kernel, and call run().
Parameters:
privilege - encapsulates privileged access to the Nachos machine.
args - the command line arguments to Nachos.

setIdleThread

public void setIdleThread(KThread idleThread)
Notify the autograder that the specified thread is the idle thread. KThread.createIdleThread() must call this method before forking the idle thread.
Parameters:
idleThread - the idle thread.

readyThread

public void readyThread(KThread thread)
Notify the autograder that the specified thread has moved to the ready state. KThread.ready() must call this method before returning.
Parameters:
thread - the thread that has been added to the ready set.

runningThread

public void runningThread(KThread thread)
Notify the autograder that the specified thread is now running. KThread.restoreState() must call this method before returning.
Parameters:
thread - the thread that is now running.

finishingCurrentThread

public void finishingCurrentThread()
Notify the autograder that the current thread has finished. KThread.finish() must call this method before putting the thread to sleep and scheduling its TCB to be destroyed.

timerInterrupt

public void timerInterrupt(Privilege privilege,
                           long time)
Notify the autograder that a timer interrupt occurred and was handled by software if a timer interrupt handler was installed. Called by the hardware timer.
Parameters:
privilege - proves the authenticity of this call.
time - the actual time at which the timer interrupt was issued.

exceptionHandler

public boolean exceptionHandler(Privilege privilege)
Notify the autograder that a user program executed a syscall instruction was executed.
Parameters:
privilege - proves the authenticity of this call.
Returns:
true if the kernel exception handler should be called.