summaryrefslogtreecommitdiffstats
path: root/CONTEXT.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-08-02 01:34:58 +0200
committersalmonik <salmonik@tuta.io>2026-08-02 01:35:37 +0200
commit94d40dadeddfb40cd4fd237294037a562405a2c2 (patch)
treed099fa89a248b53eb7c17ca08489d05e3f50fa8f /CONTEXT.md
parentrsnix v0.5.3: fix real-hardware scroll wedge — per-word display push (diff)
downloadrs-dos-94d40dadeddfb40cd4fd237294037a562405a2c2.tar.gz
rs-dos-94d40dadeddfb40cd4fd237294037a562405a2c2.zip
v0.5.4: shadow backbuffer can no longer alias the framebuffer
Real-hardware scroll freeze (no exception, QEMU-clean) — the per-word push (0.5.3) did not fix it, so the wedge is upstream of the push. A QEMU slow-display simulation (new DISPLAY_STALL knob + shell 'stall' command busy-waits per display store, mimicking an uncached real-GPU framebuffer) proved the per-word push and shadow memmove are slow but finite — the shell keeps ticking, scrolls eventually complete. The freeze mechanism QEMU cannot exhibit is the shadow *landing on the framebuffer*: the heap free list spans the fb hole, so the 1.9 MB heap shadow can alias the display on machines where firmware reports the fb as ConventionalMemory — every scroll then becomes an MMIO->MMIO memcpy on an uncached framebuffer, which wedges real hardware (a stall, no fault, hence no dump). Fix: - gop::init_shadow(): allocate the shadow from the fb-aware page allocator (init_page_allocator marks fb pages used per-page), so it can never overlap the display; heap allocation kept only as a fallback with an explicit overlap rejection. Boot log now prints 'gop: shadow @ <addr> ... origin=page-alloc|heap|none'. - Scroll shadow memmove converted to per-word stores (belt and suspenders — immune to any future fb-aliased shadow). - Verified on QEMU: shadow @ 0x100000 vs fb 0x80000000..0x801d5000, overlap=false; all 5 test suites pass; scroll completes even under the stalled-display simulation.
Diffstat (limited to '')
-rw-r--r--CONTEXT.md28
1 files changed, 19 insertions, 9 deletions
diff --git a/CONTEXT.md b/CONTEXT.md
index bf1e01f..1a1470c 100644
--- a/CONTEXT.md
+++ b/CONTEXT.md
@@ -113,17 +113,21 @@ Workspace version is `a.b.c` (single version for all crates):
113 113
114Bump the workspace version in the root `Cargo.toml` when a change of 114Bump the workspace version in the root `Cargo.toml` when a change of
115that class lands — do not leave the version to drift. Current: 115that class lands — do not leave the version to drift. Current:
116`0.5.3` — the GUI era landed with 0.5.0 (graphics layer + cursor 116`0.5.4` — the GUI era landed with 0.5.0 (graphics layer + cursor
117compositor); 0.5.1 fixed the canvas at 800×600; 0.5.2 added fault 117compositor); 0.5.1 fixed the canvas at 800×600; 0.5.2 added fault
118diagnostics (screen + serial dumps for every CPU exception) and 118diagnostics (screen + serial dumps for every CPU exception) and
119real-hardware hardening (framebuffer-size clamping, fb-region exclusion 119real-hardware hardening (framebuffer-size clamping, fb-region exclusion
120from the allocators, authoritative fb geometry logging); 0.5.3 fixed 120from the allocators, authoritative fb geometry logging); 0.5.3 changed
121the real-hardware scroll wedge — the scroll's full-frame push is now 121the scroll's full-frame push to per-word volatile stores like the
122per-word volatile stores like the boot-time `clear()` instead of one 122boot-time `clear()` instead of one 1.92 MB rep-movsb (a REP MOVS to an
1231.92 MB rep-movsb, which can stall forever on an uncached real-GPU 123uncached real-GPU framebuffer can stall forever — a stall, not an
124framebuffer (a stall, not an exception — hence no crash dump). A 124exception — hence no crash dump); 0.5.4 allocates the shadow
125future major GUI overhaul (graphics windows beyond the text surface) 125backbuffer from the fb-aware page allocator (it can no longer land on
126would be the `a` bump (1.0.0). 126the framebuffer — the heap free list spans the fb hole, so a 1.9 MB
127shadow could alias the display and turn every scroll into an MMIO→MMIO
128memcpy) and converts the scroll's shadow memmove to per-word stores as
129a belt-and-suspenders measure. A future major GUI overhaul (graphics
130windows beyond the text surface) would be the `a` bump (1.0.0).
127 131
128## Project layout 132## Project layout
129 133
@@ -562,7 +566,13 @@ Workspace of four crates, all built for the `x86_64-unknown-uefi` target:
562 uncached real-GPU framebuffer wedged the CPU on some hardware (a 566 uncached real-GPU framebuffer wedged the CPU on some hardware (a
563 stall, not an exception — no dump fired), while the boot-time 567 stall, not an exception — no dump fired), while the boot-time
564 `clear()` — the same per-word pattern — always worked. QEMU's 568 `clear()` — the same per-word pattern — always worked. QEMU's
565 RAM-backed framebuffer never showed it. 569 RAM-backed framebuffer never showed it. **The shadow itself is
570 allocated from the fb-aware page allocator (0.5.4)** so it can
571 never land on the framebuffer: the heap's free list spans the fb
572 hole, so a 1.9 MB heap shadow could alias the display, making
573 every scroll an MMIO→MMIO memcpy that wedges real hardware. The
574 scroll's shadow memmove is also per-word stores (0.5.4) as a
575 belt-and-suspenders guard against any future fb-aliased shadow.
566 2. deferred scroll batching (`vt::PENDING_SCROLLS`): the logical grid 576 2. deferred scroll batching (`vt::PENDING_SCROLLS`): the logical grid
567 scrolls instantly in RAM while the framebuffer shift+push is 577 scrolls instantly in RAM while the framebuffer shift+push is
568 deferred; N pending scrolls cost one push. Bursts of streaming 578 deferred; N pending scrolls cost one push. Bursts of streaming