MICROPROCESSOR BOOT CODE: MULTIPROCESSOR BOOT SEQUENCES

MULTIPROCESSOR BOOT SEQUENCES

In Chapter 5, the multi-core microprocessor unit, or multiprocessor chipset, was discussed in detail, including its architectures, function blocks, working mechanisms and technical specifications. This section will concentrate on the techniques related to booting and resetting such chipsets.

(1) Microprocessors in multiprocessor systems

To maintain compatibility with existing software products, the following is based on the Intel microprocessor family. Figure 15.3 gives a different point of view of a compliant system, showing the configuration of the CPUs of a multiprocessor system. While all CPUs in a compliant system are functionally identical, this figure classifies them into two types: the bootstrap processor (BSP) and the application processors (AP). Which processor is the BSP is determined by hardware or by hardware in conjunction with the BIOS. This differentiation is for convenience and is in effect only relevant during the initialization and shutdown processes. The BSP is responsible for initializing the system and for booting the operating system; APs are activated only after the operating system is up and running. CPU1 is designated as the BSP. CPU2, CPU3, and so on, are designated as the APs.

Microprocessor boot code-0125

A microprocessor-specific initialization is one of the basic support functions of a compliant multiprocessor system, along with processor start-up and shutdown. With it, the BSP can selectively initialize an AP for subsequent start-up, or recover from a fatal system error. This type of initialization function is exclusively used by the multiprocessor operating system or BIOS self-test routine. The system must be designed so that it can be performed by software programming; it should not be initiated by hardware.

(2) BIOS of a multiprocessor system

A BIOS always functions as an insulator between the hardware on one hand, and the operating system and applications software on the other hand. A standard uniprocessor BIOS (a) tests system components; (b) builds configuration tables to be used by the operating system; (c) initializes the micro- processor and the rest of the system to a known state; and (d) provides run-time device-oriented services.

For a multiprocessor system, the BIOS may perform the following additional functions: (a) pass configuration information to the operating system that identifies all microprocessors and other components of the system; (b) initialize all microprocessors and the rest of the components to a known state.

The multiprocessor chipset offers a wide range of capability in the BIOS. At the lower end of the capability scale, the system developer can simply insert a multiprocessing floating pointer structure in the standard BIOS. The cost of this level of simplicity in the BIOS, however, is that the system developer has less flexibility in the design of the hardware. At the higher end of the BIOS capability scale might be a BIOS that dynamically configures the system to provide resilience in the face of component mal- functions. Provision must be made to prevent all processors from executing the BIOS after a power-on reset. System developers may choose to do this by hardware alone, or by cooperation between hardware and the BIOS. In the latter case, the BIOS may be used for selecting the BSP and placing all APs to sleep after POST. It may use the advanced programmable interrupt controller (APIC) ID to identify each processor and select the proper code sequence to execute. Only the selected BSP continues to load the operating system after the POST routine.

(3) Operating system of a multiprocessor system

Two types of operating systems are able to utilize a multiprocessor: partitioned and symmetric multiprocessing. In partitioned architecture, each CPU boots into separate segments of physical memory and operates independently; in a symmetric system, microprocessors work in a shared space, executing threads within the operating system independently. This goal is achieved by allowing a flexible balance between the capabilities of the hardware and those of the BIOS. The potentially vast variety of hardware configurations is reduced by the BIOS to a few simple scenarios that can be readily handled by the low-level boot-up phase of the operating system.

One of the main functions of the system BIOS is to construct the multiprocessor floating pointer structure and the configuration table. Because this table is optional, the BIOS must set the multi- processor feature information bytes in the multiprocessor floating pointer structure to indicate whether a multiprocessor configuration table is present. If the table is required, the BIOS constructs it in conjunction with the BSP and APs. The BIOS is responsible for synchronizing the activities of the APs during the construction of the table. It may need some synchronization during initialization so that each microprocessor may be brought up in the proper order. The mechanism for synchronization is not specified; however, an example described in the following paragraphs uses AP status flags as a synchronization mechanism. This procedure also initializes the APs serially. System developers may employ other mechanisms, and may initialize all processors in parallel to minimize the system start-up time. The BIOS maintains an initialized AP status flag for each AP. Each AP will begin executing the same BIOS code as the BSP, but will eventually be put in a halt state or held in a loop until the BSP enables its AP status flag.

(4) Boot sequence of a multiprocessor system

Once system power is applied or the reset button is pressed (if the system is so equipped), a hardware circuit generates a system reset sequence to put all the system hardware into an initial state. All active microprocessors start to execute instructions and enter the POST (power-on-self-test) procedure of the BIOS, which initializes all components and constructs various system tables.

The goal of the hardware environment of a multiprocessor chipset is that a single, shrink-wrapped operating system can boot-up and fully utilize a wide variety of multiprocessor systems. The following explains how the operating system can handle (a) operating-system boot-up; (b) self-configuration; (c) interrupt mode initialization; (d) application processor start-up; (e) application processor shutdown; (f) dynamic interrupt masking; and (g) support for unequal processors.

While all microprocessors in a multiprocessing-compliant system are functionally identical, one of them will be designated as the bootstrap processor (BSP) at system initialization. The remainder are designated as the application processors (APs). The BSP is responsible for booting the operating system, but once this is running, the BSP functions as an AP. Usually a microprocessor is designated as the BSP because it is capable of controlling all system hardware, including AP start-up and shutdown. It is not necessarily the first microprocessor, especially in fault-tolerant multiprocessor systems in which this designation can be given to any available microprocessor.

When the first instruction of the operating system is executed, the APs can be the following states:

(a) the APs have been restrained (either by the BIOS or by the hardware) from executing operating system code;

(b) the APs are in a halted condition with interrupts disabled; this means that the AP’s local APICs are

passively monitoring the APIC bus and will react only to interprocessor interrupts.

The operating system’s first task is to determine whether the system conforms to the multiprocessor specification made by the manufacturer. This is done by searching for the multiprocessor floating pointer structure. If detected, this indicates that the system is multiprocessor-compliant, and the operating system should continue to look for the multiprocessor configuration table. If the system is not multiprocessor-compliant, the operating system may attempt other means of multiprocessor system detection, if it is capable of doing so, or treat the system as a uniprocessor system.

The AP may be started either by the BSP or by another active AP. The operating system causes application processors to start executing their initial tasks by using a universal algorithm. This consists of a sequence of interprocessor interrupts and short programmatic delays to allow the APs to respond to the wakeup commands, and assumes that the BSP is starting an AP for documentation convenience.

Some older operating systems for multiprocessors cannot support microprocessors of different types, speeds, or capabilities. However, as microprocessor lifetimes increase and new generations of microprocessors arrive, the potential for dissimilarity among microprocessors increases. Most multiprocessor specifications addresses this possibility by providing a configuration table to help the  operating system configure itself. Operating system writers should factor in microprocessor variations, such as microprocessor type, family, model, and features, to arrive at a configuration that maximizes overall system performance. At a minimum, the multiprocessor operating system should remain operational and should support the common features of unequal processors.

Incoming search terms:

Leave a comment

Your email address will not be published. Required fields are marked *