{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
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.
Image of page 1

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

View Full Document Right Arrow Icon
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() .
Image of page 2
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.
Image of page 3

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

View Full Document Right Arrow Icon
The MIPS registers and memory management hardware are initialized for the new process. Control is transferred to user mode via Machine.run() .
Image of page 4
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() .
Image of page 5

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

View Full Document Right Arrow Icon
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.
Image of page 6
NOFF Format
Image of page 7

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

View Full Document Right Arrow Icon
NOFF Magic Number The magic number at the beginning of a NOFF file allows the OS to reject non-executable files.
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern