diff --git a/xtoskrnl/README.md b/xtoskrnl/README.md index 924c95e..318a28f 100644 --- a/xtoskrnl/README.md +++ b/xtoskrnl/README.md @@ -15,6 +15,9 @@ The following is a consolidated list of available kernel parameters: scheduler tick. Valid values include `LAPIC` (Local APIC Timer), `HPET` (High Precision Event Timer), and `PIT` (Legacy Programmable Interval Timer). If this parameter is omitted, the kernel will autonomously probe the hardware and select the most optimal clock source for the current CPU topology, (defaulting to the Local APIC on modern systems. + * **NOX2APIC**: Explicitly disables x2APIC support. When specified, the kernel bypasses hardware feature detection for + x2APIC and forces the use of the classic, memory-mapped (MMIO) xAPIC mode. This parameter is particularly useful for + troubleshooting interrupt routing issues or ensuring compatibility with specific hypervisors and legacy emulators. * **NOXPA**: Disables PAE or LA57 support, depending on the CPU architecture. This parameter is handled by the bootloader, which configures paging and selects the appropriate Page Map Level (PML) before transferring control to the kernel. diff --git a/xtoskrnl/hl/x86/pic.cc b/xtoskrnl/hl/x86/pic.cc index 0132078..9e8fb70 100644 --- a/xtoskrnl/hl/x86/pic.cc +++ b/xtoskrnl/hl/x86/pic.cc @@ -102,6 +102,14 @@ BOOLEAN HL::Pic::CheckX2ApicSupport(VOID) { PKPROCESSOR_CONTROL_BLOCK Prcb; + PCWSTR KernelParameter; + + /* Check if the user forced xAPIC via boot parameters */ + if(KE::BootInformation::GetKernelParameter(L"NOX2APIC", &KernelParameter) == STATUS_SUCCESS) + { + /* The NOX2APIC flag is present, explicitly disable x2APIC support */ + return FALSE; + } /* Get current processor control block */ Prcb = KE::Processor::GetCurrentProcessorControlBlock();