Invoke: the caller's thread runs the server
A synchronous, migrating-thread call. No server thread is woken, nothing is queued in the kernel. Nesting is bounded by the thread's kernel stack.
In Syx a server's handler runs on its client's thread, so it never waits: it answers, or starts the work and answers at once, and the client waits outside the server. The kernel enforces it. On top of this model runs a POSIX environment with bash and GCC, in which GNU make builds itself.
Can a general-purpose operating system be a microkernel whose servers never block, with every wait moved out to the client, and still keep a useful POSIX environment?
Proof · a real build, recorded
The GNU make 4.4.1 source tarball is unpacked, configured and built with
make -j4 inside Syx, by the Syx build of bash, GCC 15.3.0,
binutils, coreutils, sed, gawk and grep. Every process that
configure and make start is a POSIX process on
the microkernel; every file read goes through a filesystem server whose
handlers never sleep.
configure and make -j4
are shown ten times faster, marked ×10 in the corner; nothing
else is edited. 66 s, no sound.
About 322 s of guest time under QEMU TCG (ADR 0025). A functional
test, not a performance claim. The make jobserver needs
pselect with SIGCHLD in the mask (ADR 0024).
01 · The idea
A server handler holds its client's thread and one of the server's few invoke stacks. So it must not wait for anything.
An invoke is a migrating-thread call: the calling thread itself switches into the server and runs the handler there, on one of the server's sixteen invoke stacks. A handler that sleeps keeps both. Other clients then wait for a stack or fail; the sleeping client cannot be interrupted until it leaves the server; and a wait that depends on another request to the same server is a deadlock.
Syx therefore moves every wait out of the servers:
OPERATION, a one-slot completion object, with a request that may have to wait.wait4).
A thread running a handler on behalf of another process gets
KERR_INVOKE_WAIT_IN_HANDLER at once, without sleeping, from
a sleep, a wait on an object, or a wait with a deadline. A server's own
threads may wait: they hold no client.
The rule was reached service by service: pipes and wait4,
the terminal, then the filesystem, measured with a kernel inventory of
every wait made inside a handler, and only then enforced. Once no
handler sleeps, a client waiting for a free invoke stack cannot
deadlock, so it now waits in FIFO order instead of failing
(ADR 0028).
Why this model → The rule in detail → ADRs 0015–0028 →
02 · Built around it
A synchronous, migrating-thread call. No server thread is woken, nothing is queued in the kernel. Nesting is bounded by the thread's kernel stack.
A missing page is requested from a pager in the server that backs
the VMO. The pager may answer PAGER_PENDING, release
its stack, and supply the page later; concurrent faults join one
request.
Syx is not Linux; it emulates the Linux i386 syscall ABI for
programs linked with musl. posixrt runs inside each
POSIX process and talks to the servers over invoke.
03 · Structure
Everything above the kernel is a process. Drivers take I/O ports and IRQs through kernel objects and export an interface like any other server. Arrows are invokes; the dashed arrow is a page fault served by a pager.
04 · What runs
Real programs, cross-compiled against musl with small Syx patches: bash 5.3, GCC 15.3.0 and binutils 2.47, GNU make 4.4.1, coreutils, grep, sed, gawk, diffutils, findutils, tar and gzip.
fork, execve, wait4, process groups and sessions, pipes, POSIX signals including faults delivered as SIGSEGV/SIGBUS.
select, pselect, poll, ppoll on pipes and the terminal; interruptible waits with deadlines; alarm and interval timers.
FAT (read-only) and a writable RAM filesystem; executables mapped from file VMOs and paged in on demand; asynchronous reads and page-ins in the filesystem servers.
Virtual terminals on the VGA text console, served by a terminal server: a minimal line discipline with canonical mode, termios ioctls, interactive bash with readline.
A monotonic clock in the kernel; civil time in a user-space time service backed by an RTC driver.
A built-in profiler: tick samples, kernel time, invoke time per server and per-syscall counters in posixrt.
Full status and known limits →
05 · Method
Interface changes are written down as decision records before any code, and every regular run of the test suites boots Syx headless under QEMU. How that works, and why, is on the Why Syx? page.