summaryrefslogtreecommitdiffstats
path: root/scripts/test-msg.sh
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-08-01 19:52:05 +0200
committersalmonik <salmonik@tuta.io>2026-08-01 19:52:05 +0200
commit819778f292ee4e1294603b98662e083e49e23463 (patch)
tree8df31b678432d2a89cac8e0d50f271a75a3882b5 /scripts/test-msg.sh
parentrsnix v0.4.0: GUI input foundation — PS/2 mouse + scheduler message queues (diff)
downloadrs-dos-819778f292ee4e1294603b98662e083e49e23463.tar.gz
rs-dos-819778f292ee4e1294603b98662e083e49e23463.zip
rsnix v0.5.0: graphics layer + cursor compositor
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 <id>' 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.
Diffstat (limited to '')
-rwxr-xr-xscripts/test-msg.sh37
1 files changed, 19 insertions, 18 deletions
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"
93wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell" 93wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell"
94 94
95echo "==> 4/5 drive the shell (msgrecv / send / mouse routing / queue-full)" 95echo "==> 4/5 drive the shell (msgrecv / send / mouse routing / queue-full)"
96# msgrecv spawns as task 3 (task 2 is the cursor task).
96python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \ 97python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \
97 "msgrecv" \ 98 "msgrecv" \
98 "send 2 user 42" \ 99 "send 3 user 42" \
99 "send 2 timer" \ 100 "send 3 timer" \
100 "send 2 key enter" \ 101 "send 3 key enter" \
101 "send 2 key ctrl-c" \ 102 "send 3 key ctrl-c" \
102 "send 2 key f3" \ 103 "send 3 key f3" \
103 "send 2 mouse 5 -3 3" \ 104 "send 3 mouse 5 -3 3" \
104 "sleep 800" \ 105 "sleep 800" \
105 "jobs" 106 "jobs"
106 107
107# Real IRQ12 events through the queue: start routing to task 2, inject 108# Real IRQ12 events through the queue: start routing to task 3, inject
108# moves + a left press, stop. 109# moves + a left press, stop.
109python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "mouse 2" 110python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "mouse 3"
110qemu_hmp "mouse_move 20 7" 111qemu_hmp "mouse_move 20 7"
111qemu_hmp "mouse_button 1" 112qemu_hmp "mouse_button 1"
112qemu_hmp "mouse_move -5 -3" 113qemu_hmp "mouse_move -5 -3"
@@ -140,20 +141,20 @@ python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \
140echo "==> 5/5 wait for shutdown + verify" 141echo "==> 5/5 wait for shutdown + verify"
141wait_qemu_exit 30 || fail "QEMU did not exit after poweroff" 142wait_qemu_exit 30 || fail "QEMU did not exit after poweroff"
142 143
143grep -aq "msgrecv: task 2 listening" "$LOG" || fail "msgrecv did not spawn" 144grep -aq "msgrecv: task 3 listening" "$LOG" || fail "msgrecv did not spawn"
144grep -aq "msgrecv\[2\]: User(42)" "$LOG" || fail "user message missing" 145grep -aq "msgrecv\[3\]: User(42)" "$LOG" || fail "user message missing"
145grep -aq "msgrecv\[2\]: Timer" "$LOG" || fail "timer message missing" 146grep -aq "msgrecv\[3\]: Timer" "$LOG" || fail "timer message missing"
146grep -aq "msgrecv\[2\]: Key(Enter)" "$LOG" || fail "key enter missing" 147grep -aq "msgrecv\[3\]: Key(Enter)" "$LOG" || fail "key enter missing"
147grep -aq "msgrecv\[2\]: Key(Ctrl-c)" "$LOG" || fail "key ctrl-c missing" 148grep -aq "msgrecv\[3\]: Key(Ctrl-c)" "$LOG" || fail "key ctrl-c missing"
148grep -aq "msgrecv\[2\]: Key(F3)" "$LOG" || fail "key f3 missing" 149grep -aq "msgrecv\[3\]: Key(F3)" "$LOG" || fail "key f3 missing"
149grep -aq "msgrecv\[2\]: Mouse(+5,-3 L R)" "$LOG" || fail "synthesized mouse message missing" 150grep -aq "msgrecv\[3\]: Mouse(+5,-3 L R)" "$LOG" || fail "synthesized mouse message missing"
150# Real IRQ12 events routed through the queue (button held across the move). 151# Real IRQ12 events routed through the queue (button held across the move).
151grep -aq "msgrecv\[2\]: Mouse(+20,+7" "$LOG" || fail "real mouse move 20,7 not routed to queue" 152grep -aq "msgrecv\[3\]: Mouse(+20,+7" "$LOG" || fail "real mouse move 20,7 not routed to queue"
152grep -aq "msgrecv\[2\]: Mouse(-5,-3 L" "$LOG" || fail "held-button routed move missing" 153grep -aq "msgrecv\[3\]: Mouse(-5,-3 L" "$LOG" || fail "held-button routed move missing"
153grep -aq "queue full" "$LOG" || fail "17th send did not report queue full" 154grep -aq "queue full" "$LOG" || fail "17th send did not report queue full"
154grep -aq "send: unknown type" "$LOG" && fail "a bad send slipped through (expected none)" 155grep -aq "send: unknown type" "$LOG" && fail "a bad send slipped through (expected none)"
155 156
156echo "" 157echo ""
157echo "PASS — message queues OK (all types, ordering, real-input routing, queue-full)" 158echo "PASS — message queues OK (all types, ordering, real-input routing, queue-full)"
158echo " sent: user · timer · key(enter,ctrl-c,f3) · mouse · 16+1 queue-full" 159echo " sent: user · timer · key(enter,ctrl-c,f3) · mouse · 16+1 queue-full"
159echo " routed: mouse_move 20,7 → queue → msgrecv[2]" 160echo " routed: mouse_move 20,7 → queue → msgrecv[3]"