Nachos runs user programs in their own private address space. Nachos can run any MIPS binary, assuming that it restricts itself to only making system calls that Nachos understands. In Unix, ``a.out'' files are stored in ``coff'' format. Nachos requires that executables be in the simpler ``Noff'' format. To convert binaries of one format to the other, use the coff2noff program. Consult the Makefile in the test directory for details.
Noff-format files consist of four parts. The first part, the Noff header, describes the contents of the rest of the file, giving information about the program's instructions, initialized variables and uninitialized variables.
The Noff header resides at the very start of the file and contains pointers to the remaining sections. Specifically, the Noff header contains:
For each of the remaining sections, Nachos maintains the following information:
When executing a program, Nachos creates an address space and copies the contents of the instruction and initialized variable segments into the address space. Note that the uninitialized variable section does not need to be read from the file. Since it is defined to contain all zeros, Nachos simply allocates memory for it within the address space of the Nachos process and zeros it out.