diff options
Diffstat (limited to 'docs/adr')
| -rw-r--r-- | docs/adr/0004-windowed-gui-and-compositor.md | 4 | ||||
| -rw-r--r-- | docs/adr/0005-persistent-terminal-and-disk-controller.md | 48 |
2 files changed, 50 insertions, 2 deletions
diff --git a/docs/adr/0004-windowed-gui-and-compositor.md b/docs/adr/0004-windowed-gui-and-compositor.md index 3476fab..87f637e 100644 --- a/docs/adr/0004-windowed-gui-and-compositor.md +++ b/docs/adr/0004-windowed-gui-and-compositor.md | |||
| @@ -74,5 +74,5 @@ Introduce an overlapping-window GUI: | |||
| 74 | - The existing `vt` dirty-cell path is demoted to a per-terminal-window | 74 | - The existing `vt` dirty-cell path is demoted to a per-terminal-window |
| 75 | trigger; the window manager becomes the only writer of the framebuffer | 75 | trigger; the window manager becomes the only writer of the framebuffer |
| 76 | (plus the cursor overlay). | 76 | (plus the cursor overlay). |
| 77 | - Open (not yet decided): the terminal-app design (per-instance vt + shell), | 77 | - Open (not yet decided): the save/image-format + image-viewer design |
| 78 | and the save/image-format + image-viewer design (both deferred). | 78 | (deferred). The terminal-app design is captured in ADR 0005. |
diff --git a/docs/adr/0005-persistent-terminal-and-disk-controller.md b/docs/adr/0005-persistent-terminal-and-disk-controller.md new file mode 100644 index 0000000..dee62d1 --- /dev/null +++ b/docs/adr/0005-persistent-terminal-and-disk-controller.md | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | # ADR 0005 — Persistent terminal program, per-instance shell/vt, and a disk-write controller | ||
| 2 | |||
| 3 | ## Status | ||
| 4 | |||
| 5 | Accepted. | ||
| 6 | |||
| 7 | ## Context | ||
| 8 | |||
| 9 | The GUI (ADR 0004) left the console as a special "layer 0" rendered | ||
| 10 | straight into the shared shadow, with a single shell (task 0) reading a | ||
| 11 | global keyboard buffer and being the only thing that touches the disk. We | ||
| 12 | want a TempleOS-inspired **persistent terminal program**: a full-screen, | ||
| 13 | always-present command line, plus the ability to spawn additional terminal | ||
| 14 | windows. | ||
| 15 | |||
| 16 | ## Decision | ||
| 17 | |||
| 18 | - **Home terminal** — a real window (own pixel buffer, composited by the | ||
| 19 | WM) that is full-screen, chrome-less (no title bar / minimize / close), | ||
| 20 | bottom-pinned (never raised), and never closes. It is the persistent | ||
| 21 | desktop. | ||
| 22 | - **F1 terminals** — ordinary windows (640×400, title bar, movable, | ||
| 23 | closable via F4 and the close button) running additional shell instances. | ||
| 24 | - **Per-instance** — `vt` becomes a per-instance `Terminal` (cell grid, | ||
| 25 | cursor, ANSI parser, scroll); `tty` and `shell` become per-instance too. | ||
| 26 | Each terminal owns one of each. | ||
| 27 | - **Input** — every terminal's shell reads `TaskMsg::Key` from its own task | ||
| 28 | queue (routed by the WM's input pump to the focused window). No terminal | ||
| 29 | reads the global keyboard buffer; there is one input path for all. | ||
| 30 | - **Rendering** — a terminal renders its text grid into its window's pixel | ||
| 31 | buffer; the WM composites it like any other window. This supersedes the | ||
| 32 | scroll-hook workaround from ADR 0004. | ||
| 33 | - **Disk controller** — `fs`/`fat` remain the disk owner, but every | ||
| 34 | mutating operation is wrapped in a re-entrant preemption-disable lock, | ||
| 35 | serializing concurrent access from multiple shells. Per-call granularity. | ||
| 36 | - **Background** — a terminal's running command keeps producing output into | ||
| 37 | its buffer while unfocused (free from preemptive multitasking plus | ||
| 38 | per-terminal buffers). | ||
| 39 | |||
| 40 | ## Consequences | ||
| 41 | |||
| 42 | - Positive: the console is a first-class program; multiple terminals share | ||
| 43 | one coherent input path; concurrent disk access is safe. | ||
| 44 | - Negative: the preemption-disable disk lock stalls the scheduler during | ||
| 45 | disk I/O (fine on QEMU's RAM-backed disk; revisit for real hardware). | ||
| 46 | - Negative: a substantial refactor of `vt`/`tty`/`shell` from globals to | ||
| 47 | instances. | ||
| 48 | - The "only the shell touches the disk" assumption is removed. | ||
