Skip to main content

Module syscalls

Module syscalls 

Source
Expand description

syscall interface: x86 convention via int80. syscall nr in rax, up to 3 parameters in rdi, rsi, rdx. Return value in rax

Constantsยง

SYS_EXIT ๐Ÿ”’
SYS_WRITE ๐Ÿ”’
syscall numbers TODO: use a syscall loockup table

Functionsยง

dispatch
dispatch a syscall. TODO: re-enable interrupts to make the kernel preemptive TODO: add constants for errnos
sys_exit
sys_exit(code)
sys_writeโš 
sys_write(fd, buf, len) -> number of bytes written currently only support fd==1 (stdout).