SchOS/.claude/memory/schunix-syscall-single-table.md
Nexoniarz 3182da3965 Carry project memory in the repo, with tools/memory-sync.sh
Claude Code keeps per-project memory at <home>/.claude/projects/<key>/,
where <key> is the project's absolute path with every separator and the
drive colon turned into a dash. That makes it both rename-fragile and
machine-specific, and this project has hit each of those once:

  - D:\DEV\Schunix -> D:\DEV\SchOS changed the key, and 43 memories were
    invisible until moved across by hand.
  - Development happens from Windows and from Linux, and each looks in a
    different place for the same checkout.

Committing .claude/memory/ fixes both -- git carries it across renames
and between hosts -- and `import` puts it wherever the local machine
expects. .claude/settings.local.json stays ignored: those are per-machine
permissions.

The colon maps to a dash rather than being dropped. Deleting it gives
D-DEV-SchOS, which matches nothing and silently finds zero memories; that
was the first attempt. On Git Bash the key comes from `cygpath -w`,
because Claude Code is a Windows program and sees D:\DEV\SchOS, not
/d/DEV/SchOS.
2026-08-09 14:27:22 +02:00

1.5 KiB

name description metadata
schunix-syscall-single-table Syscalls are declared once in kernel/sys/table.inc — never hand-edit linux_abi.c
node_type type originSessionId modified
memory project d1a1ea76-f919-411c-b0ef-0e1bc5064563 2026-08-01T19:34:55.691Z

Since 2026-08-01 a Schunix syscall is declared in exactly one place:

SYSCALL(nr, linux_nr, name)          // kernel/sys/table.inc
SYSCALL_ALIAS(linux_nr, name)        // extra Linux number -> existing handler

and implemented as SYSCALL_DEFINE(name) { ... } in a kernel/sys/sys_*.c.

Generated from that one line: the SYS_* enum (include/syscall.h), the dispatch table (kernel/sys/syscall.c), and the Linux ABI translation map (kernel/sys/linux_abi.c).

Why: it used to take three edits in two files — a table.inc line, a #define LINUX_foo N, and a map entry. Forgetting the second file left the syscall unreachable from every musl-linked program while looking correctly registered. linux_abi.c went from 361 hand-written lines to 34 generated ones.

How to apply: never add anything to linux_abi.c — there is nothing to edit there. NO_LINUX marks a syscall with no Linux equivalent; all such entries collide on scratch index 511, which is never dispatched.

184 syscalls, 150 with Linux numbers, 7 aliases (vfork→fork, preadv→readv, …).

See schunix-linux-abi-decision — dropping the native ABI entirely is still the plan; this refactor is the prerequisite, not a replacement for it.