Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; enable long mode
- mov ecx, 0xc0000080 ; set the C-register (EFER MSR)
- rdmsr
- or eax, 1 << 8; set LM-bit
- wrmsr
- ; set cr3 to point to page table
- mov eax, PHYS(init_pml4)
- mov cr3, eax
- ; enable paging
- mov eax, cr0
- or eax, 1 << CR0_PAGING_ENABLE_BIT
- mov cr0, eax
- ; load the 64-bit GDT
- lgdt [PHYS(gdt.gdtr)]
- jmp KERNEL_CODE_SELECTOR:PHYS(long_mode)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement