Added support for basic x86 features

Includes 'gdt', 'idt' and a serial driver
This commit is contained in:
Michael Shaw 2023-02-27 18:36:15 -05:00
commit ca5351b847
11 changed files with 231 additions and 67 deletions

39
init/descriptor.S Normal file
View file

@ -0,0 +1,39 @@
#define __ASM__
#include <kernel/gdt.h>
#include <kernel/idt.h>
/*
* Data section
*/
.data
.global __gdtr
__gdtr:
.word 0
.quad 0
.global __gdt
__gdt:
.skip GDT_SIZE
.global __idtr
__idtr:
.word 0
.quad 0
.global __idt
__idt:
.skip IDT_SIZE
/*
* Code Section
*/
.text
.global gdt_load
gdt_load:
lgdt (__gdtr)
ret
.global idt_load
idt_load:
lidt (__idtr)
ret