Next: Testing System Calls:
Up: No Title
Previous: What to Turn
- The bulk of the changes you will make will be in exception.cc You will have to make changes to other files as well to
support changes to these files. You may also need to create some new
files/classes as your implementation demands. The design choices are
completely up to you.
- Go through main.cc and system.cc in the threads
directory to understand how Nachos starts up and executes user
programs.
- If you are unclear about how to compile user programs for
Nachos, look at the Makefile in the test directory. See how the
sample user program halt is compiled.
- As we recommend for Lab 2, implement, compile, and test your
program in small, manageable peices, instead of implementing
everything and then compiling and testing.
- In order to test your implementation for exception handling, you
will have to put some instructions in your user programs that you know
will cause the kernel to raise an exception. Two examples are
division by zero, integer overflow in addition or subtraction. You
should put some code in your user program to cause the above to see
how the kernel jumps to your exception handler and executes the code
you place there.
- Read Section 4 in Thomas Narten's handout. If you haven't
done so already, read Section 3.1 as well.
When you finish making changes to the file, compile in the usual way -
type gmake depend and then gmake nachos to create a new
executable. Note that the -x option provided by Nachos runs a
user program on top of Nachos. You should use this option to test
your system call implementation.