1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2025-02-24 15:55:41 -05:00
kernel/arch/x86/protected.asm

24 lines
328 B
NASM
Raw Normal View History

2017-11-02 16:01:00 +00:00
#include "config.h"
2017-11-01 05:26:22 +00:00
[GLOBAL gdt_flush]
[GLOBAL idt_flush]
2017-11-01 05:26:22 +00:00
gdt_flush:
mov eax, [esp+4]
lgdt [eax]
2017-11-02 16:01:00 +00:00
mov ax, GDT_KERNEL_DS_SELECTOR
2017-11-01 05:26:22 +00:00
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
2017-11-02 16:01:00 +00:00
jmp GDT_KERNEL_CS_SELECTOR:.flush
2017-11-01 05:26:22 +00:00
.flush:
ret
idt_flush:
mov eax, [esp+4]
lidt [eax]
ret