diff --git a/boot/freeldr/freeldr/ntldr/arch/i386/winldr.c b/boot/freeldr/freeldr/ntldr/arch/i386/winldr.c index 2a2054ff405..3b7674d236a 100644 --- a/boot/freeldr/freeldr/ntldr/arch/i386/winldr.c +++ b/boot/freeldr/freeldr/ntldr/arch/i386/winldr.c @@ -455,6 +455,12 @@ WinLdrSetProcessorContext( /* Re-initialize EFLAGS */ __writeeflags(0); + /* Disable paging first before disabling PAE to avoid crash + * because UEFI might have enabled paged mode with PAE. + * Our kernel doesn't support PAE, so disable it. */ + __writecr0(__readcr0() & ~CR0_PG); + __writecr4(__readcr4() & ~CR4_PAE); + /* Set the PDBR */ __writecr3((ULONG_PTR)PDE);