reimplements the gdt
This commit is contained in:
23
kernel/arch/gdt/gdt.s
Normal file
23
kernel/arch/gdt/gdt.s
Normal file
@ -0,0 +1,23 @@
|
||||
gdtr DW 0 ; limit store
|
||||
DD 0 ; base storage
|
||||
|
||||
global setGdt
|
||||
setGdt:
|
||||
mov ax, [esp + 4]
|
||||
mov [gdtr], ax
|
||||
mov eax, [esp + 8]
|
||||
mov [gdtr + 2], eax
|
||||
lgdt [gdtr]
|
||||
ret
|
||||
|
||||
global reloadSegments
|
||||
reloadSegments:
|
||||
jmp 0x08:.reload_CS ; 0x08 is a stand in for the code segment
|
||||
.reload_CS:
|
||||
mov ax, 0x10 ; stand in for the data segment
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
mov ss, ax
|
||||
ret
|
Reference in New Issue
Block a user