The Processor's Role in Today's Systems

Processor Activities at Startup

Refer to Figure 1-2 on page 14. At boot time, the processor performs the following functions:

  • Fetches and executes the system's Power-On Self-Test (POST) program from the boot ROM.

  • Reads the OS loader program from mass storage.

  • Executes the OS loader program which loads the remainder of the OS kernel into system memory. The OS loader then hands control over to the OS kernel.

  • Executes the OS kernel startup code which completes the setup of the OS and loads the loadable device drivers associated with the installed devices into memory. As each loadable device driver is loaded into system memory, the OS calls the driver's initialization code in order to complete the setup of the associated device.

Figure 1-2. Processor Actions at Startup


At this point, the OS is fully-functional and awaits the end user's pleasure.

Processor Activities During Run-Time

Load and Run Application Programs

When the end user selects an application program to be executed, the OS (executing on the system processor) locates the target application program on a mass storage device, loads its startup code into system memory and begins execution of the application program.

Application Program Calls the OS

When the application program requires an action on the part of the OS (e.g., the allocation of one or more buffers in system memory for the application's use), it calls the OS and processor execution switches to the requested OS code. After completing the requested action, the OS instructs the processor to resume execution of the application program.

Handling External Hardware Interrupts

While the application program or the OS is being executed by the processor, a device external to the processor may require servicing. It signals this to the processor by generating an interrupt to the processor. Upon receipt of the interrupt, the processor suspends execution of the currently executing program (OS or application) and jumps to the interrupt handler associated with the interrupting device to handle this event. Upon completion of the interrupt service routine, the processor automatically resumes execution of the interrupted program.

Calling a Device Driver

When an application program requires interaction with a device, it calls the OS. Upon receiving a request from an application program, or if the OS itself requires interaction with a device, the OS calls the appropriate device driver. Upon completion of the request, the device driver instructs the processor to return to the execution of the OS code that called the driver.

Handling Software Exceptions

In the event of an unexpected software-related event (e.g., when required data or code is not currently in memory), the processor automatically jumps to and begins execution of the appropriate software exception handler. The handler attempts to fix the problem (e.g., by loading the appropriate page of code or data from mass storage into system memory) and then instructs the processor to reattempt execution of the instruction that caused the exception.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.9.141