Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    ; enable long mode
  2.    mov ecx, 0xc0000080 ; set the C-register (EFER MSR)
  3.    rdmsr
  4.    or eax, 1 << 8; set LM-bit
  5.    wrmsr
  6.  
  7.    ; set cr3 to point to page table
  8.    mov eax, PHYS(init_pml4)
  9.    mov cr3, eax
  10.  
  11.    ; enable paging
  12.    mov eax, cr0
  13.    or eax, 1 << CR0_PAGING_ENABLE_BIT
  14.    mov cr0, eax
  15.  
  16.    ; load the 64-bit GDT
  17.    lgdt [PHYS(gdt.gdtr)]
  18.    jmp KERNEL_CODE_SELECTOR:PHYS(long_mode)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement