SlopOS
Architecture

Syscalls

Syscall entry and dispatch architecture

The syscall layer is the privileged API between Ring 3 userland and the Ring 0 kernel. The ABI source defines numeric assignments; these docs describe the entry path, handler model, and compatibility expectations.

Entry

Normal userland enters with SYSCALL. Early boot configures the x86-64 syscall MSRs so the CPU jumps to the kernel entry trampoline, masks the expected flags, and uses the configured kernel/user selector layout.

The trampoline snapshots the user register file into a user context. The dispatcher parses register arguments through typed argument wrappers and routes to the matching handler.

Handler groups

GroupExamples
Coreyield, exit, time, system info, reboot
Processspawn, wait, exec, fork, clone, identity
Memoryheap break, mappings, protection, shared memory
Filesystempath operations, fd operations, poll/select, ioctl
Networkingsockets, TCP/UDP, DNS, message send/receive
Signalssignal actions, masks, delivery, return
Pollable process and signal fdspidfd and signalfd
SlopRingsetup, enter, registration
UI and TTYframebuffer, input, clipboard, terminal operations
Testskernel/userland test reporting and harness control

ABI discipline

  • Add or change numeric ABI assignments only in the ABI source.
  • Keep assigned slots stable; gaps are allowed.
  • Prefer typed user-pointer and user-slice wrappers over raw register handling.
  • Add userland wrappers where the syscall is meant to be public.
  • Add dispatch, success-path, and error-path tests.
  • Update public docs for stable behavior, not for every internal handler move.

See Adding a syscall for the contributor flow.

On this page