#include <addrspace.h>
Public Methods | |
| AddrSpace () | |
| Create an address space. More... | |
| ~AddrSpace () | |
| De-allocate an address space. More... | |
| void | Execute (char *fileName) |
| Run the the program stored in the file "executable". More... | |
| void | SaveState () |
| Save address space-specific info on a context switch. More... | |
| void | RestoreState () |
| Restore address space-specific info on a context switch. More... | |
Private Methods | |
| bool | Load (char *fileName) |
| Load the program into memory return false if not found. More... | |
| void | InitRegisters () |
| Initialize user-level CPU registers, before jumping to user code. More... | |
Private Attributes | |
| TranslationEntry* | pageTable |
| Assume linear page table translation for now! More... | |
| unsigned int | numPages |
| Number of pages in the virtual address space. More... | |
Definition at line 24 of file addrspace.h.
|
|
Create an address space. AddrSpace::AddrSpace Create an address space to run a user program. Set up the translation from program memory to physical memory. For now, this is really simple (1:1), since we are only uniprogramming, and we have a single unsegmented page table Definition at line 54 of file addrspace.cc. |
|
|
De-allocate an address space. AddrSpace::~AddrSpace Dealloate an address space. Definition at line 75 of file addrspace.cc. |
|
|
Run the the program stored in the file "executable". AddrSpace::Execute Run a user program. Load the executable into memory, then (for now) use our own thread to run it. "fileName" is the file containing the object code to load into memory Definition at line 152 of file addrspace.cc. Referenced by UserProgKernel::Run().
|
|
|
Initialize user-level CPU registers, before jumping to user code. AddrSpace::InitRegisters Set the initial values for the user-level register set. We write these directly into the "machine" registers, so that we can immediately jump to user code. Note that these will be saved/restored into the currentThread->userRegisters when this thread is context switched out. Definition at line 182 of file addrspace.cc. Referenced by Execute().
|
|
|
Load the program into memory return false if not found. AddrSpace::Load Load a user program into memory from a file. Assumes that the page table has been initialized, and that the object code file is in NOFF format. "fileName" is the file containing the object code to load into memory Definition at line 92 of file addrspace.cc. Referenced by Execute().
|
|
|
Restore address space-specific info on a context switch. AddrSpace::RestoreState On a context switch, restore the machine state so that this address space can run. For now, tell the machine where to find the page table. Definition at line 223 of file addrspace.cc. Referenced by Execute().
|
|
|
Save address space-specific info on a context switch. AddrSpace::SaveState On a context switch, save any machine state, specific to this address space, that needs saving. For now, don't need to save anything! Definition at line 212 of file addrspace.cc. |
|
|
Number of pages in the virtual address space.
Definition at line 40 of file addrspace.h. |
|
|
Assume linear page table translation for now!
Definition at line 38 of file addrspace.h. |
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001