#include "copyright.h"#include "utility.h"#include "translate.h"Go to the source code of this file.
Compounds | |
| class | Machine |
| The following class defines the simulated host workstation hardware, as seen by user programs -- the CPU registers, main memory, etc. User programs shouldn't be able to tell that they are running on our simulator or on the real hardware, except we don't support floating point instructions the system call interface to Nachos is not the same as UNIX (10 system calls in Nachos vs. 200 in UNIX!) If we were to implement more of the UNIX system calls, we ought to be able to run Nachos on top of Nachos! The procedures in this class are defined in machine.cc, mipssim.cc, and translate.cc. More... | |
Defines | |
| #define | StackReg 29 |
| User's stack pointer. More... | |
| #define | RetAddrReg 31 |
| Holds return address for procedure calls. More... | |
| #define | NumGPRegs 32 |
| 32 general purpose registers on MIPS. More... | |
| #define | HiReg 32 |
| Double register to hold multiply result. More... | |
| #define | LoReg 33 |
| #define | PCReg 34 |
| Current program counter. More... | |
| #define | NextPCReg 35 |
| Next program counter (for branch delay). More... | |
| #define | PrevPCReg 36 |
| Previous program counter (for debugging). More... | |
| #define | LoadReg 37 |
| The register target of a delayed load. More... | |
| #define | LoadValueReg 38 |
| The value to be loaded by a delayed load. More... | |
| #define | BadVAddrReg 39 |
| The failing virtual address on an exception. More... | |
| #define | NumTotalRegs 40 |
Enumerations | |
| enum | ExceptionType { NoException, SyscallException, PageFaultException, ReadOnlyException, BusErrorException, AddressErrorException, OverflowException, IllegalInstrException, NumExceptionTypes } |
Functions | |
| void | ExceptionHandler (ExceptionType which) |
| Entry point into Nachos for handling user system calls and exceptions Defined in exception.cc. More... | |
| unsigned int | WordToHost (unsigned int word) |
| unsigned short | ShortToHost (unsigned short shortword) |
| unsigned int | WordToMachine (unsigned int word) |
| unsigned short | ShortToMachine (unsigned short shortword) |
Variables | |
| const int | PageSize = 128 |
| set the page size equal to the disk sector size, for simplicity. More... | |
| const int | NumPhysPages = 32 |
| const int | MemorySize = (NumPhysPages * PageSize) |
| const int | TLBSize = 4 |
| if there is a TLB, make it small. More... | |
|
|
The failing virtual address on an exception.
|
|
|
Double register to hold multiply result.
|
|
|
|
|
|
The register target of a delayed load.
|
|
|
The value to be loaded by a delayed load.
|
|
|
Next program counter (for branch delay).
|
|
|
32 general purpose registers on MIPS.
|
|
|
|
|
|
Current program counter.
|
|
|
Previous program counter (for debugging).
|
|
|
Holds return address for procedure calls.
|
|
|
User's stack pointer.
|
|
|
|
Entry point into Nachos for handling user system calls and exceptions Defined in exception.cc. ExceptionHandler Entry point into the Nachos kernel. Called when a user program is executing, and either does a syscall, or generates an addressing or arithmetic exception. For system calls, the following is the calling convention: system call code -- r2 arg1 -- r4 arg2 -- r5 arg3 -- r6 arg4 -- r7 The result of the system call, if any, must be put back into r2. And don't forget to increment the pc before returning. (Or else you'll loop making the same system call forever! "which" is the kind of exception. The list of possible exceptions are in machine.h. Definition at line 57 of file exception.cc. |
|
|
Definition at line 54 of file translate.cc. |
|
|
Definition at line 69 of file translate.cc. |
|
|
Definition at line 40 of file translate.cc. |
|
|
Definition at line 66 of file translate.cc. |
|
|
|
|
|
|
|
|
set the page size equal to the disk sector size, for simplicity.
|
|
|
if there is a TLB, make it small.
|
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001