From 0d2ddecc9aeb232746b76b4eebdb1381053a8951 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Mon, 27 Jan 2025 02:05:07 +0000 Subject: checkpoint. we can fake syscall with the dummy gdt --- boot/fake_syscall_entry.S | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 boot/fake_syscall_entry.S (limited to 'boot/fake_syscall_entry.S') 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 + -- cgit v1.3.1-1-g115d