Organize system calls

* syscalls should all return j6_status_t now
* syscalls are grouped by category in name as well as in files
This commit is contained in:
Justin C. Miller
2019-07-05 22:27:16 -07:00
parent 19cd01ef8d
commit b056d95920
16 changed files with 149 additions and 144 deletions

View File

@@ -11,8 +11,9 @@ getpid:
push rbp
mov rbp, rsp
mov rax, 0x02 ; getpid syscall
syscall ; pid is now already in rax, so just return
; address of out var should already be in rdi
mov rax, 0x13 ; getpid syscall
syscall ; result is now already in rax, so just return
pop rbp
ret
@@ -33,7 +34,7 @@ sleep:
push rbp
mov rbp, rsp
mov rax, 0x21 ; sleep syscall
mov rax, 0x16 ; sleep syscall
syscall
pop rbp
@@ -44,8 +45,9 @@ fork:
push rbp
mov rbp, rsp
mov rax, 0x03
syscall ; pid left in rax
; address of out var should already be in rdi
mov rax, 0x12
syscall ; result left in rax
pop rbp
ret
@@ -57,7 +59,7 @@ message:
mov rbp, rsp
; message should already be in rdi
mov rax, 0x10
mov rax, 0x14
syscall
pop rbp