diff --git a/paw/stos/arch/amd64/cpu/lapic.c b/paw/stos/arch/amd64/cpu/lapic.c index dc52a22..3cc0bfc 100644 --- a/paw/stos/arch/amd64/cpu/lapic.c +++ b/paw/stos/arch/amd64/cpu/lapic.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -39,6 +40,20 @@ LapicIsSupported(VOID) return ISSET(Edx, BIT(9)) != 0; } +/* + * Enable the Local APIC unit + */ +static VOID +LapicEnable(VOID) +{ + UQUAD ApicBase; + + /* Hardware enable the Local APIC unit */ + ApicBase = MdRdmsr(IA32_APIC_BASE_MSR); + ApicBase |= LAPIC_HW_ENABLE; + MdWrmsr(IA32_APIC_BASE_MSR, ApicBase); +} + VOID MdLapicInit(KPCR *Kpcr) { @@ -49,4 +64,6 @@ MdLapicInit(KPCR *Kpcr) if (!LapicIsSupported()) { KeKnot(KNOT_MISSING_HARDWARE, "local apic not supported\n"); } + + LapicEnable(); }