mov eax, gInitialPML4 - KERNEL_BASE
mov cr3, eax
- ; Enable long/compatability mode
+ ; Enable IA-32e mode
+ ; (Also enables SYSCALL and NX)
mov ecx, 0xC0000080
rdmsr
- or ax, 0x100
+ or eax, (1 << 11)|(1 << 8)|(1 << 0) ; NXE, LME, SCE
wrmsr
; Enable paging
jmp .loop
.hlt:
+ cli
+ hlt
jmp .hlt
[section .data]