From 975a9ec96e282e437ccc1bdf1e660dcbf4542791 Mon Sep 17 00:00:00 2001 From: EmulatedSeasons <89668582+EmulatedSeasons@users.noreply.github.com> Date: Fri, 10 May 2024 01:44:59 -0400 Subject: Added GDT and basic IDT as well as a bitmap drawing function --- kernel/arch/x86_64/load_desc.asm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 kernel/arch/x86_64/load_desc.asm (limited to 'kernel/arch/x86_64/load_desc.asm') diff --git a/kernel/arch/x86_64/load_desc.asm b/kernel/arch/x86_64/load_desc.asm new file mode 100644 index 0000000..df65c72 --- /dev/null +++ b/kernel/arch/x86_64/load_desc.asm @@ -0,0 +1,29 @@ +; GDT and IDT loading routines + +section .text +global load_gdt:function +load_gdt: + lgdt [rdi] + ret + +global reload_segments:function +reload_segments: + ; reload cs register + push 0x08 + lea rax, [rel .reload_cs] + push rax + retfq + +.reload_cs: + mov ax, 0x10 + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + mov ss, ax + ret + +global load_idt:function +load_idt: + lidt [rdi] + ret \ No newline at end of file -- cgit v1.2.3-70-g09d2