mirror of
https://github.com/reactos/reactos.git
synced 2026-05-31 16:31:07 +08:00
[FREELDR] Fix UEFI IA-32 boot (#8886)
The PAE flag might be enabled on some x86-32 UEFI platforms, causing a crash in the kernel. ``` Assertion C:\reactos-master\reactos\ntoskrnl\mm\ARM3\miarm.h(971): PointerPte->u.Hard.Valid == 0 nt!MI_WRITE_VALID_PTE+0x28: 822d1d08 cd2c int 2Ch ``` Tested using qemu with `OVMF32_CODE_4M.fd` firmware, and with 32bit UEFI in VMware.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user