diff options
author | Benji Dial <benji@benjidial.net> | 2024-01-15 15:44:20 -0500 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-01-15 15:44:20 -0500 |
commit | c9a1266d219a83882735a3a8304f3824e0219cdb (patch) | |
tree | fea71a0b5b0de8f3a8962dc6ed417273f231e2a9 /kernel/syscall.asm | |
parent | 7c6a18d77a81f232ad2e1d3a311bb21ea8f1f5b4 (diff) | |
download | hilbert-os-c9a1266d219a83882735a3a8304f3824e0219cdb.tar.gz |
redo application paging and system calls, rename mercury to hilbert
Diffstat (limited to 'kernel/syscall.asm')
-rw-r--r-- | kernel/syscall.asm | 70 |
1 files changed, 17 insertions, 53 deletions
diff --git a/kernel/syscall.asm b/kernel/syscall.asm index e4e0d77..c293402 100644 --- a/kernel/syscall.asm +++ b/kernel/syscall.asm @@ -4,51 +4,7 @@ global start_user_mode section .text -extern syscall_encode_color - -encode_color_syscall: - call syscall_encode_color - mov edi, eax - xor rax, rax - mov eax, edi - xor rdi, rdi - xor rsi, rsi - xor rdx, rdx - jmp syscall_return - -extern syscall_get_fb_vaddr -extern syscall_get_fb_dims -extern syscall_get_fb_pitch - -get_framebuffer_syscall: - call syscall_get_fb_vaddr - push rax - call syscall_get_fb_dims - push rax - call syscall_get_fb_pitch - xor rsi, rsi - mov esi, eax - pop rdi - pop rax - xor rdx, rdx - jmp syscall_return - -extern syscall_copy_framebuffer - -draw_framebuffer_syscall: - call syscall_copy_framebuffer - xor rax, rax - xor rdi, rdi - xor rsi, rsi - xor rdx, rdx - jmp syscall_return - -bad_syscall: - xor rax, rax - xor rdi, rdi - xor rsi, rsi - xor rdx, rdx - jmp syscall_return +extern do_syscall syscall_entry: mov r11, rsp @@ -56,15 +12,23 @@ syscall_entry: push r11 push rcx - cmp rax, 0 - je encode_color_syscall - cmp rax, 1 - je get_framebuffer_syscall - cmp rax, 2 - je draw_framebuffer_syscall - jmp bad_syscall + push rdx + push rsi + push rdi + push rax + + mov rdi, rsp + lea rsi, [rsp + 8] + lea rdx, [rsp + 16] + lea rcx, [rsp + 24] + + call do_syscall + + pop rax + pop rdi + pop rsi + pop rdx -syscall_return: xor r8, r8 xor r9, r9 xor r10, r10 |