tac0S
Template Affectional Command Operating System
|
Public Member Functions | |
AddrSpace (OpenFile *executable) | |
Create an address space,. More... | |
~AddrSpace () | |
De-allocate an address space. More... | |
void | InitRegisters () |
Initialize user-level CPU registers,. More... | |
void | SaveState () |
Save/restore address space-specific. More... | |
void | RestoreState () |
info on a context switch More... | |
AddrSpace::AddrSpace | ( | OpenFile * | executable | ) |
Create an address space,.
AddrSpace::AddrSpace Create an address space to run a user program. Load the program from a file "executable", and set everything up so that we can start executing user instructions.
Assumes that the object code file is in NOFF format.
First, 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
[in] | executable | is the file containing the object code to load into memory |
AddrSpace::~AddrSpace | ( | ) |
De-allocate an address space.
AddrSpace::~AddrSpace Dealloate an address space. Nothing for now!
void AddrSpace::InitRegisters | ( | ) |
Initialize user-level CPU registers,.
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.
void AddrSpace::RestoreState | ( | ) |
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.
void AddrSpace::SaveState | ( | ) |
Save/restore address space-specific.
AddrSpace::SaveState On a context switch, save any machine state, specific to this address space, that needs saving.
For now, nothing!