diff --git a/code/userprog/exception.cc b/code/userprog/exception.cc index b6e0247..67dc603 100644 --- a/code/userprog/exception.cc +++ b/code/userprog/exception.cc @@ -231,7 +231,7 @@ ExceptionHandler (ExceptionType which) { int s = machine->ReadRegister(4); char * command = new char[MAX_STRING_SIZE]; - int size = copyStringFromMachine(s, command, MAX_STRING_SIZE); + copyStringFromMachine(s, command, MAX_STRING_SIZE); do_ForkExec(command); break; } diff --git a/code/userprog/userthread.cc b/code/userprog/userthread.cc index 2dc3b92..8de15db 100644 --- a/code/userprog/userthread.cc +++ b/code/userprog/userthread.cc @@ -92,9 +92,7 @@ void do_ThreadExit(){ currentThread->space = NULL; } - DEBUG('x', "Thread killed!\n"); currentThread->Finish(); - DEBUG('x', "Thread killed!\n"); } @@ -114,16 +112,15 @@ int do_ForkExec( const char * c){ file = fileSystem->Open(c); if (file == NULL) { - printf("Unable to open file %s\n", file); + printf("Unable to open file %s\n", c); return -1; } try { space = new AddrSpace(file); }catch(const std::bad_alloc& e) { - printf("==> BAD ALLOC ERROR: no empty space\n"); - delete space; - ASSERT(false); + fprintf(stderr,"no empty space on memory\n"); + Exit(1); } fork = new Thread("forkThread");