diff options
Diffstat (limited to 'kernel/arch/x86_64/load_desc.asm')
| -rw-r--r-- | kernel/arch/x86_64/load_desc.asm | 29 |
1 files changed, 29 insertions, 0 deletions
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 |
