This commit is contained in:
Raven Scott
2026-04-03 18:46:37 -04:00
parent c02ffc6021
commit 7c9c9ae83c
19 changed files with 675 additions and 52 deletions
+2
View File
@@ -42,6 +42,8 @@ The following are set on `ctx` before the kernel starts (unless noted as overwri
| **`runBinCommand(argv)`** | Runs a command with the **same** resolution rules as the interactive shell (used by **`time`**, **`xargs`**, and similar) |
| **`registerKernelShutdownHook(fn)`** | Register an async or sync function to run when the REPL session ends, **before** initd disposers (`clearInterval`, …). See [`bare-initd.js`](../packages/bare-os-booter/lib/bare-initd.js) |
Kernel boot composition lives on the **system image** (`/boot/init.js`, `/etc/bare-os/rc`, `/etc/bare-os/rc.d/`), not on `ctx`—extend the image or hooks like `registerKernelShutdownHook` rather than adding boot fields to the context object.
After [`createKernelReplSession`](../packages/bare-os-booter/lib/repl-session.js) returns:
- **`ctx.execLine(line)`** runs a **full shell line** (tokenize, builtins, pipelines, `/bin` resolution)—this is what the default [`kernel/init.js`](../kernel/init.js) uses in its loop.