Aufgabe 5: Zeitscheiben
Application Processor Boot. More...
Functions | |
void | relocateSetupCode () |
Relocate the real mode setup code. More... | |
void | boot () |
Boot all application processors. More... | |
Constants | |
constexpr GDT::SegmentDescriptor | ap_gdt [] |
Temporary Global Descriptor Table. More... | |
const uintptr_t | RELOCATED_SETUP = 0x40000 |
Address (below 1 MiB) to which the setup code gets relocated. | |
Detailed Description
Application Processor Boot.
Interface to boot the APs
Function Documentation
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.
- Note
- You could also tell the linker script to put the code directly at the appropriate place, but unfortunately the Qemu multiboot implementation (via
-kernel
parameter) can't handle it properly.
void ApplicationProcessor::boot | ( | ) |
Boot all application processors.
Performs relocation by calling relocateSetupCode()
Constant Documentation
|
constexpr |
Temporary Global Descriptor Table.
Blue print, to be copied into real mode code