diff options
| author | salmonik <salmonik@tuta.io> | 2026-08-21 17:18:09 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-08-21 17:18:09 +0200 |
| commit | fc4c563ca14ddec3de3aeef5a861f9707eaae389 (patch) | |
| tree | e88483e79ca3ca6d980cdbf984cf9278ccef1d27 /CONTEXT.md | |
| parent | wm: fix usize underflow in move_window at screen edges (diff) | |
| download | rs-dos-fc4c563ca14ddec3de3aeef5a861f9707eaae389.tar.gz rs-dos-fc4c563ca14ddec3de3aeef5a861f9707eaae389.zip | |
docs: ADR 0006 (executable binaries) + implementation plan + glossary terms
ADR 0006: PE32+ loader in rsnix, versioned exports-table ABI constructed
per invocation, task-per-binary, single dd-able system image with
/bin/cli and /bin/gui, shell-owned grammar with injected line streams,
per-terminal input discipline as prerequisite phase, frozen built-in
core, 0.6.0 at first exec.
Plan: five phases (image → input discipline → loader/exec → streams +
migration → GUI binaries), each with a QEMU verification gate.
Glossary: Binary, Loader, Exports table, System image; kind = launch
surface.
Diffstat (limited to 'CONTEXT.md')
| -rw-r--r-- | CONTEXT.md | 35 |
1 files changed, 35 insertions, 0 deletions
| @@ -116,6 +116,41 @@ message queue. A GUI program is an app; there is no separate "process" | |||
| 116 | concept — the app is its task plus its window. The home terminal is app 0 | 116 | concept — the app is its task plus its window. The home terminal is app 0 |
| 117 | (window 0). | 117 | (window 0). |
| 118 | 118 | ||
| 119 | ## Binary | ||
| 120 | |||
| 121 | A PE32+ file holding executable code that the kernel can load and run | ||
| 122 | without being recompiled into the kernel image. A binary runs against | ||
| 123 | the kernel's exported interface, never by linking kernel state directly. | ||
| 124 | Binaries come in two kinds, separated by **launch surface** rather than | ||
| 125 | implementation: **CLI binaries** live in /bin/cli and run inside a | ||
| 126 | terminal session (invoked by a shell, inheriting its input/output); | ||
| 127 | **GUI binaries** live in /bin/gui and are launchable with no terminal at | ||
| 128 | all — they own their windows — which makes enumerating launchable apps | ||
| 129 | as simple as listing /bin/gui. Every binary runs as its own task — a CLI binary's task is | ||
| 130 | waited on by the calling terminal, a GUI binary's task owns its window. | ||
| 131 | |||
| 132 | ## System image | ||
| 133 | |||
| 134 | The single dd-able FAT filesystem image the build produces: bootloader, | ||
| 135 | kernel, /bin, /etc and seed content on one volume. Imaging it onto a disk | ||
| 136 | yields a complete installed system. Binaries live on the system image | ||
| 137 | under /bin/cli and /bin/gui; the shell finds them by scanning mounted | ||
| 138 | volumes — no volume is privileged. | ||
| 139 | |||
| 140 | ## Loader | ||
| 141 | |||
| 142 | The kernel facility that takes a binary from disk, places it in memory, | ||
| 143 | and starts it. Loading changes no address-space setup — binaries run in | ||
| 144 | the one shared identity-mapped space. | ||
| 145 | |||
| 146 | ## Exports table | ||
| 147 | |||
| 148 | The interface between a binary and the kernel: a versioned table of | ||
| 149 | functions the kernel hands to a binary at entry (output, filesystem, | ||
| 150 | memory, …). The caller constructs it per invocation, so the same binary's | ||
| 151 | output can be aimed at a terminal or into the shell's filter pipeline. | ||
| 152 | All kernel state stays behind the table — a binary never owns a copy of it. | ||
| 153 | |||
| 119 | ## Terminal | 154 | ## Terminal |
| 120 | 155 | ||
| 121 | A program that presents a command line in a window: a text terminal | 156 | A program that presents a command line in a window: a text terminal |
