Fix InitDSDT called while APIC wasn't initialized

This commit is contained in:
Alex 2023-05-04 05:09:33 +03:00
parent 159fd7506a
commit 4c224557d1
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -297,6 +297,9 @@ EXTERNC NIF void Main(BootInfo *Info)
KPrint("Initializing Power Manager");
PowerManager = new Power::Power;
KPrint("Enabling Interrupts on Bootstrap Processor");
Interrupts::Enable(0);
#if defined(a64)
PowerManager->InitDSDT();
#elif defined(a32)
@ -304,9 +307,6 @@ EXTERNC NIF void Main(BootInfo *Info)
#elif defined(aa64)
#endif
KPrint("Enabling Interrupts on Bootstrap Processor");
Interrupts::Enable(0);
KPrint("Initializing Timers");
TimeManager = new Time::time;
TimeManager->FindTimers(PowerManager->GetACPI());
@ -484,6 +484,7 @@ EXTERNC __no_stack_protector NIF void Entry(BootInfo *Info)
}
// https://wiki.osdev.org/Calling_Global_Constructors
trace("There are %d constructors to call", __init_array_end - __init_array_start);
for (CallPtr *func = __init_array_start; func != __init_array_end; func++)
(*func)();