proj1_release_fixes.PATCH (26 Feb 2001) This is a patch to the Nachos code which corrects two small bugs: 1) In ElevatorBank.java, the test in atNextFloor() should be '< nextETA' instead of '> nextETA'. 2) In Timer.java, the wrong value for the time is passed to the AutoGrader. (This does not affect your solution in any way, but you must apply this fix in order to be graded correctly.) To apply this patch, 'cd' to your toplevel 'nachos' directory and type patch -p1 < proj1_release_fixes.PATCH You should see only 'succeeded' messages when you apply the patch. If you have significantly modified Timer.java, you may need to apply the change below by hand. Matt --- diff --exclude=CVS -cr nachos.old/machine/ElevatorBank.java nachos/machine/ElevatorBank.java *** nachos.old/machine/ElevatorBank.java Mon Feb 26 10:09:41 2001 --- nachos/machine/ElevatorBank.java Mon Feb 26 10:09:21 2001 *************** *** 387,393 **** } boolean atNextFloor() { ! if (!moving || Machine.timer().getTime() > nextETA) return false; Lib.assert(destination != floor); --- 387,393 ---- } boolean atNextFloor() { ! if (!moving || Machine.timer().getTime() < nextETA) return false; Lib.assert(destination != floor); diff --exclude=CVS -cr nachos.old/machine/Timer.java nachos/machine/Timer.java *** nachos.old/machine/Timer.java Mon Feb 26 10:09:42 2001 --- nachos/machine/Timer.java Mon Feb 26 10:09:21 2001 *************** *** 33,39 **** autoGraderInterrupt = new Runnable() { public void run() { Machine.autoGrader().timerInterrupt(Timer.this.privilege, ! getTime()); } }; --- 33,39 ---- autoGraderInterrupt = new Runnable() { public void run() { Machine.autoGrader().timerInterrupt(Timer.this.privilege, ! lastTimerInterrupt); } }; *************** *** 63,68 **** --- 63,70 ---- scheduleInterrupt(); scheduleAutoGraderInterrupt(); + lastTimerInterrupt = getTime(); + if (handler != null) handler.run(); } *************** *** 78,83 **** --- 80,86 ---- privilege.interrupt.schedule(1, "timerAG", autoGraderInterrupt); } + private long lastTimerInterrupt; private Runnable timerInterrupt; private Runnable autoGraderInterrupt;