Which kernel initializes first when the system boots?

I want to know which multicore processor core is initialized first when the processor boots up? (I mean at bootloader level) is the first core? or random core?

+6
source share
3 answers

You want to read the local apic, which you can read about in "Volume 2a":

http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

Each processor has a corresponding local apic, each local apix has an apic identifier register, which is assigned a unique value during system initialization.

The original core that goes online is called the boot processor (BSP) and can be any physical core on the matrix. More information is in β€œVolume 3a,” where they talk about the process of selecting a boot processor.

Here is an excerpt from vol3a:

8.4.1 BSP and AP processors

The MP Initialization Protocol defines two classes of processors: boot processor (BSP) and application processors (AP). After turning on the power or RESET of the MP system, the system equipment dynamically selects one of the processors on the system bus as the BSP. Other processors are referred to as APs.

As part of the BSP selection mechanism, the BSP flag is set in MS32 IA32_APIC_BASE (see Figure 10-5) of the BSP, indicating that it is a BSP. This flag is cleared for all other processors.

The BSP executes the BIOS boot belt code to configure the APIC environment, create system-wide data structures, and starts and initializes access points. When the BSP and AP are initialized, the BSP starts executing the operating system initialization code.

+7
source

It depends on the architecture of the processor itself. Actually there is no such standard. For example, the PS3 core has 9 cores that plan tasks for others. In this case, it is fair to think about it from the point of view of one main processing instruction before another. 8. For other processors, this is the most difficult to distinguish. It would be wise to assume that the loader sends its instructions to the set of cores, at which point any logical gate assigns commands to the kernels no matter how they are. In most cases, I know that there really is no difference between scheduling tasks at boot time and at any other time. The most basic task planning equipment will simply select the first available kernel, which usually depends on which kernel is considered the β€œfirst” on the machine. But, as I continue to say that different machines do it differently, I would suggest figuring out which kernel you are using and checking what it does. Good luck.

+1
source

Each processor has its own local APIC with an associated local APIC, this one can be read from the local APIC register (the same one that gives different identifiers for each processor)

0
source

All Articles