diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2025-07-30 14:32:01 -0400 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2025-07-30 14:32:01 -0400 |
commit | b905869a35f062a4e5072f10bec3a2ba3db0e365 (patch) | |
tree | 0666691804878857b4bb07daca8a54f5ddb8ae0b /arch/x86_64/lgdt.s | |
download | jove-kernel-b905869a35f062a4e5072f10bec3a2ba3db0e365.tar.gz jove-kernel-b905869a35f062a4e5072f10bec3a2ba3db0e365.tar.bz2 jove-kernel-b905869a35f062a4e5072f10bec3a2ba3db0e365.zip |
working userland with some invoke syscalls
Diffstat (limited to 'arch/x86_64/lgdt.s')
-rw-r--r-- | arch/x86_64/lgdt.s | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/x86_64/lgdt.s b/arch/x86_64/lgdt.s new file mode 100644 index 0000000..7122ef9 --- /dev/null +++ b/arch/x86_64/lgdt.s @@ -0,0 +1,26 @@ +.global gdt_load +.type gdt_load @function +gdt_load: + lgdt (%rdi) +.reload_segments: + pushq $0x8 + leaq .reload_cs, %rax + pushq %rax + lretq +.reload_cs: + movw $0x10, %ax + movw %ax, %ds + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + movw %ax, %ss + retq +.size gdt_load, . - gdt_load + +.global tss_flush +.type tss_flush @function +tss_flush: + movw %di, %ax + ltr %ax + retq +.size tss_flush, . - tss_flush |