summaryrefslogtreecommitdiff
path: root/boot/fake_syscall_entry.S
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2025-01-27 02:05:07 +0000
committerAda Christine <adachristine18@gmail.com>2025-01-27 02:05:07 +0000
commit0d2ddecc9aeb232746b76b4eebdb1381053a8951 (patch)
tree31fe2fc38ead88a0d982b06b3783aae4f094b8ad /boot/fake_syscall_entry.S
parent6faeb8d3aed797ddfac66ecc21fc8a717d5e848a (diff)
checkpoint. we can fake syscall with the dummy gdt
Diffstat (limited to 'boot/fake_syscall_entry.S')
-rw-r--r--boot/fake_syscall_entry.S25
1 files changed, 25 insertions, 0 deletions
diff --git a/boot/fake_syscall_entry.S b/boot/fake_syscall_entry.S
new file mode 100644
index 0000000..ff2428d
--- /dev/null
+++ b/boot/fake_syscall_entry.S
@@ -0,0 +1,25 @@
+.section .text
+
+.extern fake_syscall_handler
+
+.global fake_syscall_entry
+fake_syscall_entry:
+ hlt
+
+.global fake_syscall_return
+fake_syscall_return:
+ cli
+ mov %rdi, %rsp
+ lgdt (%rsp)
+ add $16, %rsp
+
+ movw (%rsp), %ds
+ movw (%rsp), %es
+ movw (%rsp), %fs
+ movw (%rsp), %gs
+ movw (%rsp), %ss
+
+ add $8, %rsp
+
+ lretq
+