Syscall table
The syscall number is the SVC immediate; arguments pass in r0–r3 and the result returns in r0, with negative values meaning error (see Syscall ABI for the convention and error codes for the full list). Every kernel object -port, notification, shared-memory region, device, task- is named by a handle, a small per-process slot index; userspace never holds a raw kernel pointer.
This table reflects the Loaf freeze (kernel 1.0). The numbers and signatures below are stable: a number is never renumbered or reused, and retired calls leave their slots permanently reserved rather than recycling them.
The table
Task lifecycle (0x00–0x0B)
| Number | Name | Signature |
0x00 | pquit | (status) -> never returns |
0x01 | yield | () -> 0 |
0x03 | wait | (pid, &status, flags) -> pid or -err |
0x04 | getpid | () -> pid |
0x05 | sleep | (ms) -> 0 |
0x06 | pspawn | (args*) -> {handle, pid} or -err |
0x07 | kickstart | (args*) -> 0 or -err |
0x08 | pkill | (task_handle) -> 0 or -err |
0x09 | tmake | (entry, sp, arg) -> tid or -err |
0x0A | tjoin | (tid) -> exit_status or -err |
0x0B | tquit | (status) -> never returns |
Messaging (0x10–0x17)
| Number | Name | Signature |
0x10 | send | (port, w1, w2, w3) -> 0 or -err |
0x11 | recv | (port, timeout_ms) -> source; r1–r3 payload |
0x12 | call | (port, w1, w2, w3) -> r0–r3 reply |
0x13 | reply | (reply_handle, w1, w2, w3) -> 0 or -err |
0x14 | lsend | (port, len) -> 0 or -err |
0x15 | lcall | (port, len) -> {0, recv_len} |
0x16 | lreply | (reply_handle, len) -> 0 or -err |
0x17 | waitany | (handles*, count, timeout_ms, result*) -> 0 or -err |
Handles & capabilities (0x20–0x26)
| Number | Name | Signature |
0x20 | port_create | () -> handle or -err |
0x21 | ntfn_create | () -> handle or -err |
0x22 | dev_query | (handle, out*, buf_len) -> irq or -err |
0x23 | grant | (handle, pid) -> slot or -err |
0x24 | destroy | (handle) -> 0 or -err |
0x25 | ntfn_signal | (ntfn_handle, bits) -> 0 or -err |
0x26 | ntfn_wait | (ntfn_handle, timeout_ms) -> bits or -err |
Memory (0x30–0x38)
| Number | Name | Signature |
0x30 | memmap | (handle | HANDLE_ANON, size, prot, flags) -> va or -err |
0x31 | memunmap | (addr) -> 0 or -err |
0x32 | shm_create | (size) -> handle or -err |
0x37 | memprotect | (addr, size, prot) -> 0 or -err |
0x38 | asinject | (args*) -> 0 or -err |
Interrupts (0x40–0x42)
| Number | Name | Signature |
0x41 | irq_bind | (dev_handle, ntfn_handle) -> 0 or -err |
0x42 | irq_done | (dev_handle) -> 0 or -err |