Implemented GDT initialisation

This commit is contained in:
2022-12-24 10:28:41 +00:00
parent 0c0830cca7
commit 26853c32c8
10 changed files with 129 additions and 3 deletions

28
arch/x86_64/gdt_load.S Normal file
View File

@@ -0,0 +1,28 @@
.section .text
.global gdt_load
.type gdt_load, @function
gdt_load:
pushq %rbp
movq %rsp, %rbp
lgdt (%rdi)
mov $0x10, %ax
mov %ax, %ss
mov %ax, %ds
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
movabsq $(gdt_load2), %rax
push $0x08
push %rax
lretq
gdt_load2:
popq %rbp
ret