From 819778f292ee4e1294603b98662e083e49e23463 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sat, 1 Aug 2026 19:52:05 +0200 Subject: rsnix v0.5.0: graphics layer + cursor compositor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first visible GUI surface: real rect primitives, a single shadow→display push path, and an on-screen mouse cursor that can never race the text surface. gop: - fill_rect + push_rect(x,y,w,h): every raster op rasterises into the RAM shadow, then push_rect copies the rect to the display (write-only, still never read) and composites the cursor on top. blit_glyph and scroll shifts now route through it. - cursor overlay: 12x16 pointer (const-fn built from column lists) drawn white with a black offset outline; position in one AtomicU64 (x:high 32, y:low 32) — unpack masks the low word (a bare 'as usize' cast is a no-op on 64-bit). The cursor never enters the shadow, so erasing is just a shadow push of the old rect. - cursor_redraw after scroll shifts and once at spawn (the vt diff never re-blits idle cells). cursor task (task 2, spawned at boot when a mouse is present): - owns the PS/2 ring; polls every 10 ms, moves the cursor (clamped), tracks buttons, and forwards every event to a task's queue when 'mouse ' armed it (the window-manager input path). - /dev/mouse is now a position device (x/y/buttons snapshot); 'mouse' watches the cursor live (prints on change); 'cursor' prints one-shot state; 'gfx' draws a status-bar demo; 'gfx check' is an in-kernel pixel self-test (shadow readback, display readback, cursor overlay purity) — PASS/FAIL per stage. Tests (headless QEMU + monitor injection): - make test-gfx (new): all four compositor checks PASS. - make test-mouse (rewritten): cursor tracks mouse_move deltas, buttons ride along, /dev/mouse snapshot, live watch, real-event queue routing. - make test-msg: task numbering shifted (cursor is task 2; msgrecv is task 3) — updated, still PASS. - make test-disk regression re-passes. 0 build warnings. --- scripts/test-msg.sh | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'scripts/test-msg.sh') diff --git a/scripts/test-msg.sh b/scripts/test-msg.sh index 0bd1c81..d81d8d7 100755 --- a/scripts/test-msg.sh +++ b/scripts/test-msg.sh @@ -93,20 +93,21 @@ echo $! >"$QPID" wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell" echo "==> 4/5 drive the shell (msgrecv / send / mouse routing / queue-full)" +# msgrecv spawns as task 3 (task 2 is the cursor task). python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \ "msgrecv" \ - "send 2 user 42" \ - "send 2 timer" \ - "send 2 key enter" \ - "send 2 key ctrl-c" \ - "send 2 key f3" \ - "send 2 mouse 5 -3 3" \ + "send 3 user 42" \ + "send 3 timer" \ + "send 3 key enter" \ + "send 3 key ctrl-c" \ + "send 3 key f3" \ + "send 3 mouse 5 -3 3" \ "sleep 800" \ "jobs" -# Real IRQ12 events through the queue: start routing to task 2, inject +# Real IRQ12 events through the queue: start routing to task 3, inject # moves + a left press, stop. -python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "mouse 2" +python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "mouse 3" qemu_hmp "mouse_move 20 7" qemu_hmp "mouse_button 1" qemu_hmp "mouse_move -5 -3" @@ -140,20 +141,20 @@ python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \ echo "==> 5/5 wait for shutdown + verify" wait_qemu_exit 30 || fail "QEMU did not exit after poweroff" -grep -aq "msgrecv: task 2 listening" "$LOG" || fail "msgrecv did not spawn" -grep -aq "msgrecv\[2\]: User(42)" "$LOG" || fail "user message missing" -grep -aq "msgrecv\[2\]: Timer" "$LOG" || fail "timer message missing" -grep -aq "msgrecv\[2\]: Key(Enter)" "$LOG" || fail "key enter missing" -grep -aq "msgrecv\[2\]: Key(Ctrl-c)" "$LOG" || fail "key ctrl-c missing" -grep -aq "msgrecv\[2\]: Key(F3)" "$LOG" || fail "key f3 missing" -grep -aq "msgrecv\[2\]: Mouse(+5,-3 L R)" "$LOG" || fail "synthesized mouse message missing" +grep -aq "msgrecv: task 3 listening" "$LOG" || fail "msgrecv did not spawn" +grep -aq "msgrecv\[3\]: User(42)" "$LOG" || fail "user message missing" +grep -aq "msgrecv\[3\]: Timer" "$LOG" || fail "timer message missing" +grep -aq "msgrecv\[3\]: Key(Enter)" "$LOG" || fail "key enter missing" +grep -aq "msgrecv\[3\]: Key(Ctrl-c)" "$LOG" || fail "key ctrl-c missing" +grep -aq "msgrecv\[3\]: Key(F3)" "$LOG" || fail "key f3 missing" +grep -aq "msgrecv\[3\]: Mouse(+5,-3 L R)" "$LOG" || fail "synthesized mouse message missing" # Real IRQ12 events routed through the queue (button held across the move). -grep -aq "msgrecv\[2\]: Mouse(+20,+7" "$LOG" || fail "real mouse move 20,7 not routed to queue" -grep -aq "msgrecv\[2\]: Mouse(-5,-3 L" "$LOG" || fail "held-button routed move missing" +grep -aq "msgrecv\[3\]: Mouse(+20,+7" "$LOG" || fail "real mouse move 20,7 not routed to queue" +grep -aq "msgrecv\[3\]: Mouse(-5,-3 L" "$LOG" || fail "held-button routed move missing" grep -aq "queue full" "$LOG" || fail "17th send did not report queue full" grep -aq "send: unknown type" "$LOG" && fail "a bad send slipped through (expected none)" echo "" echo "PASS — message queues OK (all types, ordering, real-input routing, queue-full)" echo " sent: user · timer · key(enter,ctrl-c,f3) · mouse · 16+1 queue-full" -echo " routed: mouse_move 20,7 → queue → msgrecv[2]" +echo " routed: mouse_move 20,7 → queue → msgrecv[3]" -- cgit v1.2.3