Exemplo n.º 1
0
  public static void raiseException(int which, int badVAddr) {
    Debug.println('m', "Exception: " + exceptionNames[which]);
    
    Debug.ASSERT(Interrupt.getStatus() == Interrupt.UserMode);
    registers[BadVAddrReg] = badVAddr;
    delayedLoad(0, 0);			// finish anything in progress
    Interrupt.setStatus(Interrupt.SystemMode);
    Nachos.exceptionHandler(which); // interrupts are enabled at this point
    Interrupt.setStatus(Interrupt.UserMode);
}
Exemplo n.º 2
0
  public static void run() {
    Instruction instr = new Instruction(); // storage for decoded instruction

    Debug.println('m', "Starting user thread " + 
		  Thread.currentThread().getName() +
		  "at time " + Nachos.stats.totalTicks);

    Interrupt.setStatus(Interrupt.UserMode);
    for (;;) {
      oneInstruction(instr);
      Interrupt.oneTick();
      if (singleStep && (runUntilTime <= Nachos.stats.totalTicks))
	debugger();
    }
  }