1
0
Fork 0
This commit is contained in:
Kevin Alavik 2025-05-30 17:50:37 +02:00
parent b7a1a35180
commit d5371bcbb2
Signed by: cmpsb
GPG key ID: 10D1CC0526FDC6D7
2 changed files with 10 additions and 10 deletions

View file

@ -78,14 +78,6 @@ void smp_init(void)
{
set_cpu_local(&cpu_locals[i]);
log_early("CPU %u is the bootstrap processor", i);
/* Disable legacy PIC to prepare for APIC */
outb(0x21, 0xff);
outb(0xA1, 0xff);
/* Setup APIC */
lapic_init();
atomic_fetch_add(&started_cpus, 1);
cpu_locals[i].ready = true;
}
@ -97,6 +89,7 @@ void smp_init(void)
}
}
/* trick to wait for all procs to be ready */
bool all_ready = false;
while (!all_ready)
{

View file

@ -166,6 +166,9 @@ void emk_entry(void)
kpanic(NULL, "Failed to get MP request");
}
mp_response = mp_request.response;
smp_init();
/* Setup ACPI */
rsdp_response = rsdp_request.response;
if (!rsdp_response)
@ -175,8 +178,12 @@ void emk_entry(void)
acpi_init();
madt_init(); // Also init MADT, to prepare for APIC
mp_response = mp_request.response;
smp_init();
/* Disable legacy PIC to prepare for APIC */
outb(0x21, 0xff);
outb(0xA1, 0xff);
/* Setup APIC */
lapic_init();
/* Finished */
log_early("%s", LOG_SEPARATOR);