StuBS
|
Application Processor Boot. More...
Functions | |
void | relocateSetupCode () |
Relocate the real mode setup code. | |
void | boot () |
Boot all application processors. | |
Constants | |
constexpr GDT::SegmentDescriptor | ap_gdt [] |
Temporary Global Descriptor Table. | |
const uintptr_t | RELOCATED_SETUP = 0x40000 |
Address (below 1 MiB) to which the setup code gets relocated. | |
Application Processor Boot.
Interface to boot the APs
void ApplicationProcessor::relocateSetupCode | ( | ) |
Relocate the real mode setup code.
The application processors (APs) start in real mode, which means that your setup code must be placed within the first megabyte – your operating system resides currently at a much higher address (16 MiB), so the code has to be copied down there first.
Luckily, the code in setup_ap()
can be relocated by copying – because it does not use any absolute addressing (except when jumping to the protected mode function startup_ap()
). The function must be copied to the address of RELOCATED_SETUP (0x40000), so that the APs can start there.
The memory section contains a reserved area for the GDT and its descriptor, which has to be assigned first with the contents of ap_gdt.
-kernel
parameter) can't handle it properly. void ApplicationProcessor::boot | ( | ) |
Boot all application processors.
Performs relocation by calling relocateSetupCode()
|
constexpr |
Temporary Global Descriptor Table.
Blue print, to be copied into real mode code
const uintptr_t ApplicationProcessor::RELOCATED_SETUP = 0x40000 |
Address (below 1 MiB) to which the setup code gets relocated.