Update GDT pointer after unmapping GDT
This commit is contained in:
parent
b5e0d749b8
commit
950de8645c
@ -68,9 +68,27 @@ jmp 0x8:V2P(long_mode_start)
|
||||
mov rax, 0
|
||||
movabs [BootP4], rax
|
||||
|
||||
//; Update page tables
|
||||
mov rax, cr3
|
||||
mov cr3, rax
|
||||
|
||||
//; Reload GDT
|
||||
movabs rax, offset BootGDTp
|
||||
lgdt [rax]
|
||||
mov rax, 0x0
|
||||
mov ss, rax
|
||||
mov ds, rax
|
||||
mov es, rax
|
||||
mov fs, rax
|
||||
mov gs, rax
|
||||
|
||||
//; Reload CS
|
||||
movabs rax, offset .reload_cs
|
||||
pushq 0x8
|
||||
push rax
|
||||
retfq
|
||||
.reload_cs:
|
||||
|
||||
//; Jump to kmain()
|
||||
.extern kmain
|
||||
movabs rax, offset kmain
|
||||
|
Loading…
x
Reference in New Issue
Block a user