16 lines
279 B
NASM
16 lines
279 B
NASM
|
global gdt_flush
|
||
|
|
||
|
gdt_flush:
|
||
|
mov eax, [esp + 4]
|
||
|
lgdt [eax]
|
||
|
; Reload segment registers
|
||
|
mov ax, 0x10 ; Kernel data segment
|
||
|
mov ds, ax
|
||
|
mov es, ax
|
||
|
mov fs, ax
|
||
|
mov gs, ax
|
||
|
mov ss, ax
|
||
|
jmp 0x08:.flush ; Kernel code segment
|
||
|
.flush:
|
||
|
ret
|