summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/hal/lxdt.s
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-09-04 11:31:40 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-09-04 11:31:40 -0400
commit8251da342161767fe203627223ccd4a7026701c6 (patch)
treeaf2db0f11b0ea8ad35f88663a855bab39a80f679 /arch/x86_64/hal/lxdt.s
downloadjove-kernel-8251da342161767fe203627223ccd4a7026701c6.tar.gz
jove-kernel-8251da342161767fe203627223ccd4a7026701c6.tar.bz2
jove-kernel-8251da342161767fe203627223ccd4a7026701c6.zip
initial commit. working on tasking
Diffstat (limited to 'arch/x86_64/hal/lxdt.s')
-rw-r--r--arch/x86_64/hal/lxdt.s26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86_64/hal/lxdt.s b/arch/x86_64/hal/lxdt.s
new file mode 100644
index 0000000..1591599
--- /dev/null
+++ b/arch/x86_64/hal/lxdt.s
@@ -0,0 +1,26 @@
+.global load_gdt
+.type load_gdt @function
+load_gdt:
+ lgdt (%rdi)
+.reload_segments:
+ pushq $0x8
+ leaq .reload_cs(%rip), %rax
+ pushq %rax
+ retfq
+.reload_cs:
+ movw $0x10, %ax
+ movw %ax, %ds
+ movw %ax, %es
+ movw %ax, %fs
+ movw %ax, %gs
+ movw %ax, %ss
+ retq
+.size load_gdt, . - load_gdt
+
+.global load_tss
+.type load_tss @function
+load_tss:
+ movw $0x30, %ax
+ ltr %ax
+ retq
+.size load_tss, . - load_tss