Kernel - Slight reworks to timer code
[tpg/acess2.git] / Kernel / arch / x86_64 / start32.asm
index da0739b..52b133c 100644 (file)
@@ -62,15 +62,16 @@ start:
        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
        mov eax, cr0
-       or eax, 0x80000000
+       or eax, 0x80010000      ; PG & WP
        mov cr0, eax
 
        ; Load GDT
@@ -90,6 +91,8 @@ start:
        jmp .loop
        
 .hlt:
+       cli
+       hlt
        jmp .hlt
 
 [section .data]

UCC git Repository :: git.ucc.asn.au