Module syscall

Source
Expand description

Implementation of syscalls

The single entry point to all system calls, syscall(), is called whenever userspace wishes to perform a system call using the ecall instruction. In this case, the processor raises an β€˜Environment call from U-mode’ exception, which is handled as one of the cases in crate::trap::trap_handler.

For clarity, each single syscall is implemented as its own function, named sys_ then the name of the syscall. You can find functions like this in submodules, and you should also implement syscalls this way.

ModulesΒ§

fs πŸ”’
File and filesystem-related syscalls
process πŸ”’

ConstantsΒ§

SYSCALL_EXEC πŸ”’
SYSCALL_EXIT πŸ”’
SYSCALL_FORK πŸ”’
SYSCALL_GETPID πŸ”’
SYSCALL_GET_TIME πŸ”’
SYSCALL_READ πŸ”’
SYSCALL_WAITPID πŸ”’
SYSCALL_WRITE πŸ”’
SYSCALL_YIELD πŸ”’

FunctionsΒ§

syscall
handle syscall exception with syscall_id and other arguments