Files
bare-operating-system/packages/bare-os-seeder/kernel
2026-04-03 19:39:13 -04:00
..
2026-04-03 19:34:11 -04:00
2026-04-03 19:01:57 -04:00
2026-04-03 19:39:13 -04:00
2026-04-03 19:39:13 -04:00
2026-04-03 19:39:13 -04:00

kernel — system image sources

Files in this directory are read from disk by the seeder (or copied into packages/bare-os-seeder/kernel/ for Pear) and written into the system Hyperdrive with no temporary directory on the host.

Staging map (seeder)

Source Drive path
init.js /boot/init.js
bin/<name> /bin/<name>
etc/... /etc/...
share/man/... /share/man/...
Any other file /<relative path>

Contents

  • init.js — Kernel entry: must define async function start(ctx). Boot order: /etc/os-release/etc/motd → optional /etc/bare-os/rc.profile.<profile> (profile from BARE_OS_BOOT_PROFILE or first line of /etc/bare-os/profile) → /etc/bare-os/rc/etc/bare-os/rc.d/* (sorted; only names starting with a digit, plus skips dotfiles, *~, README*, *.md) → banner → when BARE_OS_SKIP_REPL, optional one line from BARE_OS_ONBOOT or /etc/bare-os/onbootreadLine / execLine loop (boot snippet errors are logged, not fatal). Custom kernels may call ctx.registerKernelShutdownHook(fn) before initd disposers; use ctx.bareOsRuntimeCaps for limits and pseudo path lists (developer-guide/02-the-context-object.md).
  • bin/Tier-1 utilities built by bare-os-coreutils. Each file is runtime.js + optional lib/*-engine.js (sed, awk) or lib/man-render.js (man) + async function run(ctx, argv) (no ESM import in src/).
  • share/man/man.json — Merged manual database for /bin/man (built by bare-os-coreutils; see handbook ch.10).
  • etc/os-release — Static OS metadata (NAME, VERSION, …).
  • etc/motd — Optional message printed after os-release (distributors can customize).
  • etc/bare-os/banner or /etc/issue — If present on the system drive, the default kernel prints one of these instead of the built-in session hint (unless BARE_OS_SKIP_REPL shortens the banner). Set BARE_OS_BOOT_TRACE=1 in the session environment to log boot phase timings on stderr.
  • etc/bare-os/rc — Optional boot snippet: one execLine per non-comment line (trusted).
  • etc/bare-os/rc.d/ — Optional extra snippets (basename must start with a digit), same line rules, run after rc in filename order. Human-oriented notes live in .README (a dotfile so legacy init.js never executes it).

Editing workflow

  1. Change sources under kernel/ or packages/bare-os-coreutils/src/.
  2. Run npm run build -w bare-os-coreutils to refresh kernel/bin/*.
  3. Run seeder again to re-stage the drive (or use a fresh Corestore for a clean image).

Pear bundles use the vendored tree under packages/bare-os-seeder/kernel/; keep it in sync by running the same build before pear stage. npm test runs scripts/verify-kernel-seeder-parity.mjs (after bare-os-coreutils build) so the two trees match byte-for-byte.

See also