Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

patch to HW 2 solution

0 views
Skip to first unread message

Eric Tucker

unread,
Nov 18, 1995, 3:00:00 AM11/18/95
to
Some bugs in the HW 2 solution have recently been fixed. The fix involved
test3.cc, traphandler.cc, and syscall.cc.

If you are using the solution as a basis for your HW 3 and have already copied
and modified these files, don't worry, the changes are small. Just do
these three things:

1. In traphandler.cc, add these two cases to the switch statement in
TrapHandler():

case AddressErrorException:
printf("Memory access violation on thread %s -- "
"terminating!\n", gCurrentThread->getName());
gCurrentThread->Finish();
break;

case BusErrorException:
printf("Memory access violation on thread %s -- "
"terminating!\n", gCurrentThread->getName());
gCurrentThread->Finish();
break;

2. In test3.cc, change the single line of StartProcess() to:
Exec(fileName, 1, &fileName);

3. In syscall.cc, right under where it says
printf("ERROR: address space allocation failed!\n");
Add these three new lines:
gThreadTableLock->Acquire();
gThreadTable->Remove( (void *)thread );
gThreadTableLock->Release();

Thanks to Jun Yang for pointing out these problems.

--Eric

0 new messages