nachos.threads
Class ThreadedKernel
java.lang.Object
|
+--nachos.machine.Kernel
|
+--nachos.threads.ThreadedKernel
- Direct Known Subclasses:
- UserKernel
- public class ThreadedKernel
- extends Kernel
A multi-threaded OS kernel.
|
Constructor Summary |
ThreadedKernel()
Allocate a new multi-threaded kernel. |
|
Method Summary |
void |
initialize(String[] args)
Initialize this kernel. |
void |
run()
A threaded kernel does not run user programs, so this method does
nothing. |
void |
selfTest()
Test this kernel. |
void |
terminate()
Terminate this kernel. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
scheduler
public static Scheduler scheduler
- Globally accessible reference to the scheduler.
alarm
public static Alarm alarm
- Globally accessible reference to the alarm.
fileSystem
public static FileSystem fileSystem
- Globally accessible reference to the file system.
ThreadedKernel
public ThreadedKernel()
- Allocate a new multi-threaded kernel.
initialize
public void initialize(String[] args)
- Initialize this kernel. Creates a scheduler, the first thread, and an
alarm, and enables interrupts. Creates a file system if necessary.
- Overrides:
- initialize in class Kernel
selfTest
public void selfTest()
- Test this kernel. Test the KThread, Semaphore,
SynchList, and ElevatorBank classes. Note that the
autograder never calls this method, so it is safe to put additional
tests here.
- Overrides:
- selfTest in class Kernel
run
public void run()
- A threaded kernel does not run user programs, so this method does
nothing.
- Overrides:
- run in class Kernel
terminate
public void terminate()
- Terminate this kernel. Never returns.
- Overrides:
- terminate in class Kernel