This commit is contained in:
Raven Scott
2026-04-03 19:39:13 -04:00
parent 02904e7523
commit 54ea903bd4
19 changed files with 435 additions and 29 deletions
+3 -2
View File
@@ -23,7 +23,8 @@ The following are set on `ctx` before the kernel starts (unless noted as overwri
| Field | Role |
| ----- | ---- |
| **`bareOsCtxApiVersion`** | String semver for the documented **`ctx`** contract (e.g. **`1.1.0`**). Bump in [`bare-os-ctx-api.js`](../packages/bare-os-booter/lib/bare-os-ctx-api.js) when you make breaking changes to stable fields. |
| **`bareOsCtxApiVersion`** | String semver for the documented **`ctx`** contract (e.g. **`1.2.0`**). Bump in [`bare-os-ctx-api.js`](../packages/bare-os-booter/lib/bare-os-ctx-api.js) when you make breaking changes to stable fields. |
| **`bareOsRuntimeCaps`** | **Frozen** snapshot from [`bare-os-runtime-caps.js`](../packages/bare-os-booter/lib/bare-os-runtime-caps.js): **`ctxApiVersion`**, resolved simulated **pipeline** limits (from **`env`** / defaults), documented pseudo **`/`** paths (**`pseudoFsPaths`**), and **`features`** flags. Reflects session env at **`executeKernel`** start (including host **`BARE_OS_PIPELINE_*`** when set). |
| **`bareOsBootStartedMs`** | Epoch milliseconds when the booter started building the session (used for synthetic **`/proc/uptime`**). |
| **`bareOsSkipRepl`** | **`true`** when **`BARE_OS_SKIP_REPL=1`** (non-interactive stdin); kernels may shorten banners. |
| **`disk`** | Disk bundle used during boot (includes drives and helpers); advanced use |
@@ -44,7 +45,7 @@ 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.
Kernel boot composition lives on the **system image** (`/boot/init.js`, `/etc/bare-os/rc`, `/etc/bare-os/rc.d/`, optional **`/etc/bare-os/profile`** / **`rc.profile.*`**, **`/etc/bare-os/onboot`**), not on `ctx`—extend the image or hooks like `registerKernelShutdownHook` rather than adding boot fields to the context object. The booter seeds **`ctx.env`** from the host for **`BARE_OS_PIPELINE_MAX_STAGES`**, **`BARE_OS_PIPELINE_MAX_BYTES`**, **`BARE_OS_PIPELINE_MAX_LINES`**, **`BARE_OS_BOOT_PROFILE`**, and **`BARE_OS_ONBOOT`** when those variables are set (automation / tuning).
After [`createKernelReplSession`](../packages/bare-os-booter/lib/repl-session.js) returns: