Syscalls reference (curated)¶
Source of truth for numbers and semantics: src/kernel/syscalls.rs (syscall_dispatcher).
libc / app stubs: SDK/lib/cstd/src/sys.rs, p1ui.rs.
This table is not every arm in the dispatcher (there are duplicates and legacy stubs). It lists what normal apps and daemons rely on.
POSIX-shaped I/O and files¶
# |
Name |
Notes |
|---|---|---|
0 |
|
Resolves process-local FD; stdin reads the PTY / pipe path only — no direct PS/2 drain in |
1 |
|
Resolve FD; fd 1/2 also push trimmed UTF-8 to system log; int 0x81 yield after stdout/stderr. |
2 |
|
NUL path; cwd-relative; returns process-local FD. |
3 |
|
|
4 |
|
Two implementations exist in match — first full path-based wins for early arms; later stub may be unreachable (debt). |
5 |
|
|
8 |
|
Duplicate arms — same semantics. |
21 |
|
|
78 |
|
|
83 |
|
FAT backend. |
87 |
|
FAT delete. |
Memory¶
# |
Name |
Notes |
|---|---|---|
9 |
|
First |
227 |
|
|
230 |
|
|
231 |
|
Delegated RTL8139 port I/O only in legacy userspace NIC mode ( |
234 |
|
NIC IRQ subscriber only (netd). Maps another task’s user pages into the caller’s mmap arena: |
12 |
|
Query with |
Process / thread¶
# |
Name |
Notes |
|---|---|---|
39 |
|
|
56 |
|
|
59 |
|
Path NUL; argv/envp optional; ramdisk fast path via |
60 |
|
Shared cleanup with |
61 |
|
Sets |
62 |
|
Phased: |
63 |
|
|
64 |
|
|
158 |
|
|
Scheduling / time¶
# |
Name |
Notes |
|---|---|---|
24 |
|
|
25 |
|
Milliseconds; |
228 |
|
|
300 |
|
Packed RTC fields (moved off 200 collision with raw net). |
IPC¶
# |
Name |
Notes |
|---|---|---|
30 |
legacy |
Registers: target, type, p1–p3; no syscall-50 present remap. |
31 |
legacy |
|
50 |
|
Pointer to |
51 |
|
|
224 |
|
Compositor: drop |
225 |
|
Writes two |
226 |
|
|
235 |
|
|
IPC message_type 250 / 251 (not syscall numbers)¶
On syscall 50, message_type == 250 is WIRE_PS2D_KEY_EVENT: ps2d → compositor decoded keyboard. p1 = legacy WM scancode byte; p2 = (modifiers << 32) | key; p3 = 1 if down (make), 0 if up (break). target_pid == 0 resolves to the compositor. Unrelated to syscall 250 (write_file) in the dispatcher table below.
message_type == 251 is WIRE_PS2D_MOUSE_EVENT: ps2d → compositor — p1 packs dx and dy as two i16 in the low 32 bits, p2 carries button bits and optional wheel dz. target_pid == 0 → compositor.
message_type == 260 (WIRE_NETD_RX_RAW): netd → kernel Ethernet payload. p1 = user VA of frame, p2 = length (14…1600, clamped). Kernel copies from sender address space into the normal RX path; this message is part of the legacy userspace-NIC mode.
message_type == 261 (WIRE_KERNEL_NETD_TX): TX to netd. p2 = Ethernet length (14…1514). p3 & 1 (phys mode): p1 = physical address of the first frame byte (kernel / staging); sender_pid usually 0 — netd uses sys_iomem_map (227) then munmap. Otherwise p1 = user VA in sender_pid (e.g. sys_net_send_raw) — netd uses sys_iomem_map_user (234). netd still copies into its DMA TX scratch for RTL8139 descriptors. No kernel bounce and no syscall 233.
message_type == 271 (WIRE_TIME_SVC): time-service control channel used by p1-timesvc. p1=1 requests sync-now; response uses p1=2 success or p1=3 failure.
Signals / PTY / job control¶
# |
Name |
Notes |
|---|---|---|
13 |
|
Stub success. |
16 |
|
VFS |
220 |
|
Writes process-local master/slave fds. |
221 |
|
Maps local 0,1,2 to slave global fd. |
223 |
|
SIGINT/SIGKILL bits in |
Graphics / introspection (selected)¶
# |
Name |
Notes |
|---|---|---|
72 |
|
Identity-map assumption — security-sensitive. |
73 |
|
TCP-centric |
79 |
|
Identity-map assumption — was dead code when it shared number 73 with |
100 |
|
Framebuffer info to user; heavy mapping path. |
101 |
|
|
102 |
|
|
103 |
|
|
104–107 |
RegCube get/set/flush/load |
|
98 |
|
|
99 |
|
|
318 |
|
RDRAND-backed. |
400 |
|
Total / free frames. |
RegCube (selected)¶
Hive |
Key |
Notes |
|---|---|---|
|
|
|
|
|
Hostname for SNTP sync ( |
|
|
|
|
|
Periodic sync interval in seconds (daemon clamps minimum to |
|
|
Last SNTP outcome diagnostics. |
Networking¶
# |
Name |
Notes |
|---|---|---|
41 |
|
TCP unless type 2 (UDP) or 3 (raw-ish TCP ref). |
42 |
|
|
44 |
|
|
45 |
|
|
49 |
|
|
52 |
|
Stub no-op success. |
200 |
|
Validates Ethernet frame (14..1514). In kernel-owned mode ( |
201 |
|
|
202 |
|
|
203 |
|
Copies 16 bytes from caller (`ip |
204 |
|
|
210 |
|
|
211 |
|
Misc¶
# |
Name |
Notes |
|---|---|---|
20 |
|
stdout/stderr only → system log. |
22 |
|
|
250 |
|
Path + bytes → FAT write (legacy name). |
int 0x81¶
Fast reschedule path used from syscall layer and IRQ return plumbing — treat as yield/reschedule, not a Linux syscall number.
Kernel NIC smoke test (default path)¶
Ensure
\\boot.cfgdoes not containNET=USERSPACE.Boot and confirm logs show kernel-owned mode (
[NET] boot mode: KERNEL OWNER default ...and init saysnetd not spawned).Exercise
ping/ DNS / sockets and verifyget_network_info(103) counters change as traffic flows.Optional legacy check: run with
NET=USERSPACEand confirmnetdsubscription logs and IPC 260/261 activity.