x86/boot: enable Page Size Extensions

This single fucking bit is the reason 4MB pages
weren't working all along
main
anna 3 years ago
parent c911ff9009
commit 2a6dcf8c0c
Signed by: fef
GPG Key ID: EC22E476DC2D3D84

@ -5,6 +5,8 @@
#include <arch/multiboot.h>
#include <arch/page.h>
.code32
/* see arch/x86/config/kernel.ld */
.extern _image_start_phys
.extern _kernel_end_phys
@ -202,6 +204,11 @@ ASM_ENTRY(_start)
*/
movl $(phys_addr(pd0) + 0x003), phys_addr(pd0) + 1023 * 4 /* 0xffc00000 */
/* set the Page Size Extensions bit in cr4 */
mov %cr4, %ecx
or $0x00000010, %ecx
mov %ecx, %cr4
/* put the (physical) address of pd0 into cr3 so it will be used */
mov $phys_addr(pd0), %ecx
mov %ecx, %cr3

Loading…
Cancel
Save