20091006 - How NACHOS Loads and Executes an Application...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: How NACHOS Loads and Executes an Application Program The next several slides trace through the actions taken by the NACHOS kernel in loading and executing the halt program. NACHOS Starts Execution of NACHOS starts in method main() of class Nachos . The first thread is created and made ready to run, and the scheduler is started. The first thread begins executing the run() method of class Nachos . The first thread calls ProgTest.start() . In ProgTest The ProgTest.start() method creates a new instance of class ProgTest . The ProgTest constructor creates a new UserThread and passes it a new AddrSpace object. The new thread is made ready to run. Once in the new thread, in the ProgTest.run() method, the executable file is opened. The executable file is used to initialize the address space of the current thread. The MIPS registers and memory management hardware are initialized for the new process. Control is transferred to user mode via Machine.run() . In User Mode The halt process executes about 10-15 MIPS instruc- tions, culminating in a syscall instruction. A trap occurs back to the NACHOS kernel, which is entered via handleException() in class ExceptionHandler . The exception handler determines that a Halt() system call was requested, and it halts NACHOS by calling Interrupt.halt() . Nachos Object File Format (NOFF) A NOFF file contains information that tells the OS how to initialize the address space to run the program. A header at the beginning of file containing magic number and (three) segment descriptors . The code segment immediately follows the header. The data segment immediately follows the code segment. The od (octal dump) command is useful for viewing the contents of binary files. NOFF Format NOFF Magic Number The magic number at the beginning of a NOFF file allows the OS to reject non-executable files....
View Full Document

Page1 / 29

20091006 - How NACHOS Loads and Executes an Application...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online