1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-11-20 11:16:10 -05:00
kernel/arch/protected.asm

24 lines
328 B
NASM
Raw Normal View History

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