For this lab, you will be working mostly in the userprog directory. The first step is to read and understand the part of the system we have written for you. For this lab, you will test your system call implementation by running user programs on Nachos. At present, Nachos can run a single user-level `C' program at a time. As a test case, we've provided you with a trivial user program, `halt'; all halt does is to turn around and ask the operating system to shut the machine down. Run the program nachos -x ../test/halt from the userprog directory. As before, trace what happens as the user program gets loaded, runs, and invokes a system call.
The files for this assignment are listed below. You will need to understand all of these files for the fourth lab as well.
So far, all the code you have written for Nachos has been part of the operating system kernel. In a real operating system, the kernel not only uses its procedures internally, but allows user-level programs to access some of its routines them via ``system calls''.
In this assignment, we give you a simulated CPU that models a real CPU. In fact, the simulated CPU is the same as a real CPU (a MIPS chip), but we cannot just run user programs as regular UNIX processes, because we want complete control over how many instructions are executed at a time, how the address spaces work, and how interrupts and exceptions (including system calls) are handled.
Our simulator can run normal programs compiled from C - see the Makefile in the `test' subdirectory for an example. The compiled programs must be linked with some special flags, then converted into Nachos format, using the program ``coff2noff'' (which we supply). The only caveat is that floating point operations are not supported. This feature enables you to make your own test programs, which we encourage you to do and share with your classmates.