--- name: schfs-v2-and-ramdisk description: The agreed SchFS direction and the ramdisk-root work completed 2026-08-01 metadata: node_type: memory type: project originSessionId: d1a1ea76-f919-411c-b0ef-0e1bc5064563 modified: 2026-08-01T17:52:30.145Z --- Agreed plan for Schunix's filesystem and installer, and step 1 is done. **Order agreed 2026-08-01:** ramdisk root → `struct proc`/exit codes/pgrp → SchFS → mkfs into `cmd/` → installer + framebuffer GUI. **SchFS** keeps the name and is designed in `docs/architecture/schfs-v2.md`: copy-on-write + checksum-in-parent-pointer + uberblock array (ZFS), one CoW B-tree reused for every key type + extents with refcounts (btrfs), attribute indexes for the "SQL-like" query feel (BeFS). Explicitly NOT doing: storage pools/RAID-Z, online format conversion, dedup, or an actual query language — the useful part of "database filesystem" is the index, not SQL. WinFS is the cautionary tale; BeFS is the scale model. **Done — ramdisk root.** `make ramroot` links a full SCHFS image into the kernel and boots to a shell with no data disk attached (verified). Plain `make` is unchanged. `kernel/dev/ramdisk.c` + a `bdevrw()` dispatcher in `bio.c`. **Also done — `tools/mkfs` content dedup**, which is what made the ramdisk practical: identical files now share one inode with real hard links (`nlink > 1`). The 57 toybox applet copies collapsed from ~44 MB to one copy — inodes 73 → 19, used blocks ~47,000 → ~3,400. `mkfs` also gained `--size ` so one tool builds both the big root image and the small ramdisk one. **Why it is opt-in:** stage2 loads the kernel by PIO one sector at a time, so a 6 MB ramroot kernel is visibly slower to boot than the 350 KB default. Use `make ramroot`, never `make RAMROOT=1` — the flag changes CFLAGS, which make cannot see, so stale objects would silently keep the wrong `ROOTDEV`. See [[schunix-rewrite-priorities]], [[schunix-build-environment]].