fix: gdt work I think
This commit is contained in:
18
src/gdt/set_gdt.s
Normal file
18
src/gdt/set_gdt.s
Normal file
@ -0,0 +1,18 @@
|
||||
.intel_syntax noprefix
|
||||
|
||||
.section .text
|
||||
.global set_gdt
|
||||
|
||||
set_gdt:
|
||||
mov eax, [esp+4] // 1st parameter : pointer to the IDT
|
||||
lgdt [eax]
|
||||
mov ax, 0x10 // 0x10 is the offset in the GDT to our data segment
|
||||
mov ds, ax // Load all data segment selectors
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
mov es, ax
|
||||
mov ax, 0x18 // 0x18 is the offset in the GDT to our kernel stack
|
||||
mov ss, ax
|
||||
jmp 0x08:.flush // 0x08 is the offset to our code segment: far jump on it
|
||||
.flush:
|
||||
ret
|
Reference in New Issue
Block a user