nachos.vm
Class VMProcess

java.lang.Object
  extended by nachos.userprog.UserProcess
      extended by nachos.vm.VMProcess
Direct Known Subclasses:
NetProcess

public class VMProcess
extends UserProcess

A UserProcess that supports demand-paging.


Field Summary
 
Fields inherited from class nachos.userprog.UserProcess
coff, numPages, pageTable, stackPages
 
Constructor Summary
VMProcess()
          Allocate a new process.
 
Method Summary
 void handleException(int cause)
          Handle a user exception.
protected  boolean loadSections()
          Initializes page tables for this process so that the executable can be demand-paged.
 void restoreState()
          Restore the state of this process after a context switch.
 void saveState()
          Save the state of this process in preparation for a context switch.
protected  void unloadSections()
          Release any resources allocated by loadSections().
 
Methods inherited from class nachos.userprog.UserProcess
execute, handleSyscall, initRegisters, newUserProcess, readVirtualMemory, readVirtualMemory, readVirtualMemoryString, writeVirtualMemory, writeVirtualMemory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VMProcess

public VMProcess()
Allocate a new process.

Method Detail

saveState

public void saveState()
Save the state of this process in preparation for a context switch. Called by UThread.saveState().

Overrides:
saveState in class UserProcess

restoreState

public void restoreState()
Restore the state of this process after a context switch. Called by UThread.restoreState().

Overrides:
restoreState in class UserProcess

loadSections

protected boolean loadSections()
Initializes page tables for this process so that the executable can be demand-paged.

Overrides:
loadSections in class UserProcess
Returns:
true if successful.

unloadSections

protected void unloadSections()
Release any resources allocated by loadSections().

Overrides:
unloadSections in class UserProcess

handleException

public void handleException(int cause)
Handle a user exception. Called by UserKernel.exceptionHandler(). The cause argument identifies which exception occurred; see the Processor.exceptionZZZ constants.

Overrides:
handleException in class UserProcess
Parameters:
cause - the user exception that occurred.