next up previous contents
Next: System Calls and Exception Up: User-Level Processes Previous: Process Creation

Creating a Noff Binary

Nachos is capable of executing a program containing arbitrary MIPS instructions. For example, C programs in the test directory are compiled using gcc on a MIPS machine to create ``.o'' files. To create an a.out binary file, the loader prepends the instructions in test/start.s before the code of the user program. File start.s contains initialization code that needs to be executed before the user's main program. Specifically, the very first instruction in start.s calls the user-supplied main routine, whereas the second instruction invokes the Nachos Exit system call, insuring that user processes terminate properly when their main program returns. In addition, start.s contains stub modules for invoking system calls (described below).



Thomas Narten
Mon Feb 3 15:00:27 EST 1997