summaryrefslogtreecommitdiffstats
path: root/CONTEXT.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-08-01 16:19:45 +0200
committersalmonik <salmonik@tuta.io>2026-08-01 16:19:45 +0200
commitce43cb9554d443f12af886ee035a73bf9b322ac5 (patch)
tree4611a08b2596ab49c25793f20e126b66fea26169 /CONTEXT.md
parentrsnix: formatting (diff)
downloadrs-dos-ce43cb9554d443f12af886ee035a73bf9b322ac5.tar.gz
rs-dos-ce43cb9554d443f12af886ee035a73bf9b322ac5.zip
docs: ADR 0003 (preemptive kernel tasks) + task glossary terms
- ADR 0003: preemptive round-robin kernel tasks on the 100 Hz tick, shared address space, guard pages + page-fault handler, graceful task panics, safe-builtin spawn surface, only-shell-touches-I/O invariant - CONTEXT.md: new 'Task' glossary entry; 'Paging strategy' now says guard pages exist on task stacks
Diffstat (limited to '')
-rw-r--r--CONTEXT.md17
1 files changed, 16 insertions, 1 deletions
diff --git a/CONTEXT.md b/CONTEXT.md
index aa2392e..65475ce 100644
--- a/CONTEXT.md
+++ b/CONTEXT.md
@@ -32,7 +32,9 @@ structs are hand-defined (not from `uefi-rs` crate) to stay lightweight.
32 32
33Long mode mandates paging (`CR0.PG = 1`), so we accept that tax but keep it 33Long mode mandates paging (`CR0.PG = 1`), so we accept that tax but keep it
34simple. Identity-mapped 4-level tables, no higher-half, no demand paging, 34simple. Identity-mapped 4-level tables, no higher-half, no demand paging,
35no guard pages. `paging.rs` provides identity map/unmap/query helpers. At 35no guard pages except task stacks — each task's stack gets one unmapped
36guard page below it, and a page-fault handler turns an overflow into a
37task panic. `paging.rs` provides identity map/unmap/query helpers. At
36boot the kernel runs on UEFI's tables; `adopt_tables()` rebuilds that map 38boot the kernel runs on UEFI's tables; `adopt_tables()` rebuilds that map
37into the kernel's own tables and switches CR3 — needed because UEFI maps its 39into the kernel's own tables and switches CR3 — needed because UEFI maps its
38page-table pages read-only, so the firmware tree can't be modified in place. 40page-table pages read-only, so the firmware tree can't be modified in place.
@@ -80,6 +82,19 @@ linear frame buffer is system memory that we own once boot services are gone.
80Scancode set 1, US QWERTY layout. Hardcoded scancode→ASCII table. 82Scancode set 1, US QWERTY layout. Hardcoded scancode→ASCII table.
81Other layouts can be added later by swapping the translation table. 83Other layouts can be added later by swapping the translation table.
82 84
85## Task
86
87A unit of concurrent execution in the kernel: its own kernel stack
88(with a guard page below it), scheduler bookkeeping, and no
89address-space separation — all tasks share the one identity-mapped
90space and the kernel's facilities (TempleOS-style, not a process).
91Tasks are preemptively round-robin-scheduled on the 100 Hz PIT tick;
92the shell is task 0 and an idle `hlt` task is the always-ready
93fallback. A task may sleep, yield, and log to serial/klog; only the
94shell touches the disk, filesystem, and terminal. A panicking or
95stack-overflowing task dies gracefully (logged, marked done, slot
96reaped) without taking the kernel down.
97
83## Development loop 98## Development loop
84 99
85Standalone project — no integration with the RNG initramfs build system. 100Standalone project — no integration with the RNG initramfs build system.