Expand description
Strat9-OS syscall dispatcher.
Routes syscall numbers to handler functions and converts results to RAX values.
Called from the naked syscall_entry assembly with a pointer to SyscallFrame.
The main dispatch function is __strat9_syscall_dispatch, which matches on the syscall number and calls the appropriate handler. Each handler returns a Result<u64, SyscallError>, which is converted to a raw value in RAX (positive for success, negative for error).
The dispatch function is an alias for __strat9_syscall_dispatch used by the assembly entry point.
The syscall handlers are defined in this module and in submodules (e.g. mmap, process, signal, etc.) and cover a wide range of functionality including process management, memory management, IPC, file I/O, networking, and more.
The dispatcher also includes diagnostic logging with rate-limiting to avoid log spam under high syscall rates. For example, it logs the first 20 syscalls unconditionally, then every 10,000 syscalls thereafter. It also has budgeted logging for network send/recv errors and DHCP frame tracing.
Functionsยง
- __
strat9_ syscall_ dispatch - Main dispatch function called from
syscall_entryassembly. - dispatch
- Alias used by the
call {dispatch}in syscall_entry. Re-exports__strat9_syscall_dispatchunder the symbol the assembly expects. - sys_
net_ info - Performs the sys net info operation.
- sys_
net_ recv - Performs the sys net recv operation.
- sys_
net_ send - Performs the sys net send operation.