1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

Kernel: Setup APIC AP cores boot environment before init_stage2

Since this range is mapped in already in the kernel page directory, we
can initialize it before jumping into the first kernel process which
lets us avoid mapping in the range into init_stage2's address space.

This brings us half-way to removing the shared bottom 2 MiB mapping in
every process, leaving only the Prekernel.
This commit is contained in:
Idan Horowitz 2021-12-19 18:04:55 +02:00 committed by Brian Gianforcaro
parent 6c8f1e62db
commit fd3be7ffcc
3 changed files with 34 additions and 9 deletions

View file

@ -216,6 +216,13 @@ extern "C" [[noreturn]] UNMAP_AFTER_INIT void init(BootInfo const& boot_info)
Scheduler::initialize();
if (APIC::initialized() && APIC::the().enabled_processor_count() > 1) {
// We must set up the AP boot environment before switching to a kernel process,
// as pages below address USER_RANGE_BASE are only accesible through the kernel
// page directory.
APIC::the().setup_ap_boot_environment();
}
dmesgln("Starting SerenityOS...");
{