← board

FreeBSD native target (amd64) — raw-syscall, stays in the libc-free family

Why FreeBSD is the cheapest first win

Same family as Linux: raw-syscall ELF on amd64, identical argument registers (rdi/rsi/rdx/r10/r8/r9). Keeps the libc-free identity intact. And FreeBSD's linuxulator (linux64.ko) runs today's Linux pxx binaries unmodified — a zero-work smoke on a real BSD kernel before writing a line of code.

What differs from Linux (the whole delta)

  1. Syscall numbers — FreeBSD's own table (write=4, exit=1, …), not Linux's.
  2. Error convention — FreeBSD signals an error via the carry flag (CF set, errno in rax), NOT Linux's negative-rax. This is the real work — every syscall wrapper's error check changes, not just a number swap.
  3. ELF brand — set EI_OSABI = ELFOSABI_FREEBSD (9) or emit the NT_FREEBSD_ABI_TAG note so the kernel brands the binary correctly.
  4. exit_groupexit (no thread-group exit; adjust the process-exit path).

Plan

Acceptance

Test infra

qemu FreeBSD image (pre-built qcow2 exists) + linuxulator. The per-OS image/runner harness may live in a Track T clone (see portability-axes.md) — the compiler work is here.