<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rs-dos/rsnix/src/wm.rs, branch qemu</title>
<subtitle>Simple, kernel-only, 64bit OS, early stage.
</subtitle>
<id>https://git.2137697.xyz/rs-dos/atom?h=qemu</id>
<link rel='self' href='https://git.2137697.xyz/rs-dos/atom?h=qemu'/>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/'/>
<updated>2026-11-01T15:33:05Z</updated>
<entry>
<title>usb: real-hardware rework — hubs, both EHCI controllers, keyboard, xHCI hardening</title>
<updated>2026-11-01T15:33:05Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-11-01T15:33:05Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=50b4d2f0ab05901a847d8e1318152308265e579b'/>
<id>urn:sha1:50b4d2f0ab05901a847d8e1318152308265e579b</id>
<content type='text'>
EHCI (OptiPlex 7010 / Q77 and similar Intel PCH):
- enumerate *both* EHCI controllers (00:1a.0 + 00:1d.0), not just the first
- hub support: read the hub class descriptor, power/reset each port via hub
  class requests, read the child speed, then drive the child with split
  transactions carrying the hub's address and port (TT).  On 7-series PCH the
  root port presents the integrated Rate Matching Hub (8087:0024, class 9)
  and the mouse/keyboard sit behind it; without this the driver stopped at
  "no HID mouse/keyboard endpoint in config".
- HID mouse *and* keyboard, boot protocol + idle, per-device periodic QH
  chained into the frame list, per-device report buffers and counters
- periodic re-arm follows the standard shape (qTD re-activated, Next-qTD
  re-linked); the HC owns the status/toggle overlay
- DMA from the page allocator inside [16 MiB, 4 GiB): EHCI programs 32-bit
  addresses and the page bitmap spans all RAM
- 2 ms recovery after SET_ADDRESS

xHCI:
- scratchpad buffers (HCSPARAMS2) and MaxSlotsEn &gt; 1, with per-slot EP0 and
  interrupt rings plus per-slot device contexts
- DMA from the page allocator instead of the heap allocator
- boot protocol + idle, mouse + keyboard, first-report diagnostics
- transfer events are routed to every device before matching a waiter, so a
  second device's enumeration cannot swallow an armed device's report

shared:
- rsnix/src/hid.rs: HID usage -&gt; scancode-set-1 tables, one scancode FIFO
  feeding ps2::feed_scancode, per-device boot-keyboard report differ
- WM input pump polls PS/2 -&gt; UHCI -&gt; EHCI -&gt; xHCI
- memory::alloc_pages_range(count, min, max) for bounded DMA allocations

QEMU coverage: make test-usb (EHCI + xHCI, mouse + keyboard).  QEMU's EHCI
split path delivers only the first report for FS devices, so repeated-report
delivery and the RMH path remain hardware-test items.
</content>
</entry>
<entry>
<title>input: total keyboard routing + per-terminal discipline (ADR 0006 ph1)</title>
<updated>2026-08-21T18:13:59Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-21T18:13:59Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=2f4cf666c0c7bd224932fa48973e7334360c1de3'/>
<id>urn:sha1:2f4cf666c0c7bd224932fa48973e7334360c1de3</id>
<content type='text'>
wm: FOCUSED is now a plain window id — window 0 (home terminal) is an
ordinary focusable window in the z-order.  The CONSOLE sentinel
(usize::MAX) and the focused()==0 special cases are gone; focus_console()
is an alias for focus(0).  Desktop clicks focus window 0.  The WM input
pump routes every key unconditionally: IRQ ring -&gt; pump -&gt; focused
window's owner; nothing polls the scancode rings directly any more.

tty: read_line() reads from the calling task's message queue (the old
global-ring read_line and the duplicate read_line_from_queue are merged);
raw mode (read_byte/try_read_byte) consumes the same queue;
interrupt_pressed drains the queue instead of the ring.

shell: task 0 owns home terminal window 0 and blocks on its queue like a
windowed shell; cat/hexdump stdin paths pass the home terminal handle.

sched: watchdog comments updated (shell parks on recv_blocking).

Verified in QEMU: F1 spawns terminals, F2 cycles focus home-&gt;term1-&gt;
term2, keystrokes land only in the focused window, ^C cancels a line,
edit runs raw over the queue and exits to a working prompt; test-disk
regression PASS.
</content>
</entry>
<entry>
<title>wm: fix usize underflow in move_window at screen edges</title>
<updated>2026-08-21T02:09:57Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-21T02:09:57Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=235906cc36d9195b7b36d67f94f40cacccf030fd'/>
<id>urn:sha1:235906cc36d9195b7b36d67f94f40cacccf030fd</id>
<content type='text'>
ox.saturating_sub(pad) / oy.saturating_sub(pad) — plain subtraction
on usize wraps to usize::MAX when the window sits at x=0 or y=0,
causing composite_rect to draw at the far end of the framebuffer
instead of near the window.  Also broke drag-to-move when stuck
against the top or left edge.
</content>
</entry>
<entry>
<title>wm: 1px focus-colored border + flush full window on focus change</title>
<updated>2026-08-21T02:04:20Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-21T02:04:20Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=df13e7bf4d56d0563628472f8716afb01a96cfac'/>
<id>urn:sha1:df13e7bf4d56d0563628472f8716afb01a96cfac</id>
<content type='text'>
- draw_window_border(): 1px border around every window except the root.
  Blue (TITLE_BG_FOCUS) when focused, grey (TITLE_BG) when not.
- focus() / focus_console(): composite the full window area + border pad
  on both the old and new focused windows (was title-bar-only before).
- flush(): include border pad in the damage rectangle.
- move_window(): redraw border area at old and new positions.
- Remove redundant term.flush() from tty Focus handler (focus() covers it).
</content>
</entry>
<entry>
<title>v0.5.11: fix terminal focus — toggle ACTIVE on Focus messages</title>
<updated>2026-08-21T01:30:35Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-21T01:30:35Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=b418c26050870b900ff56d5a47f32209795aaf4a'/>
<id>urn:sha1:b418c26050870b900ff56d5a47f32209795aaf4a</id>
<content type='text'>
- tty: read_line_from_queue() now takes &amp;mut Terminal and handles
  TaskMsg::Focus: Focus(true) sets ACTIVE to the terminal,
  Focus(false) clears it.  This fixes the bug where the console
  shell's gop_print! output was redirected to the soft terminal
  even after focus switched away from it.
- shell: run_windowed() passes the terminal through to read_line_from_queue.
- wm: remove noisy per-key debug logging from pump_main.
</content>
</entry>
<entry>
<title>wm: F1 spawns a windowed shell — real shell, not a duplicate</title>
<updated>2026-08-20T11:47:10Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-20T11:47:10Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=cb17c57452ccd2ccca77e99098402d4b9f61c0a5'/>
<id>urn:sha1:cb17c57452ccd2ccca77e99098402d4b9f61c0a5</id>
<content type='text'>
Architecture:
- vt: ACTIVE terminal redirect — when set, all gop_print!/put_char/write_str
  go there instead of HOME.  Terminal::from_buffer() renders into a
  WM-owned pixel buffer.
- tty: read_line_from_queue() — canonical-mode line input from the task's
  own message queue (TaskMsg::Key).  Returns None on Close.
- shell: run_windowed() — same shell as the console but reads from the
  message queue.  Returns on ^D or window close.
- wm: F1 calls SPAWN_TERMINAL_CB (set by rsdos).  No shell logic in the WM.
- rsdos: terminal_task callback + terminal_entry task — creates a 640x400
  chrome window, wires up Terminal::from_buffer, sets ACTIVE, runs
  shell::run_windowed(), cleans up on exit.
- shell: 'term' debug command that invokes the callback directly and
  logs each step to serial.
</content>
</entry>
<entry>
<title>wm: integrate home terminal as window 0 + fix console focus after close</title>
<updated>2026-08-19T16:46:35Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-19T16:46:35Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=09a44f15678f27dd3d07f90e9ed0e71cf0e771ff'/>
<id>urn:sha1:09a44f15678f27dd3d07f90e9ed0e71cf0e771ff</id>
<content type='text'>
- wm rewrite: chrome flag per window, create_home_window for the
  console (window 0, chrome-less, bottom-pinned, never closed),
  composite_rect fills desktop background then blits windows bottom-to-top,
  draw_window_intersect handles chrome-less windows, hit_test returns
  Content for chrome-less, destroy/move_window no-op for id 0.

- vt: add window_params() so main.rs can wire the Terminal to wm window 0.

- main.rs: create home terminal window 0 and attach Terminal after wm::init().

- Focus fix: focus(0) now stores CONSOLE sentinel (not raw 0) so
  focused() returns None when the home terminal has focus. Without this,
  closing a GUI window left FOCUSED=0, which tty::poll_key() interpreted
  as 'a GUI app has focus', spinning forever and swallowing all keyboard
  input.
</content>
</entry>
<entry>
<title>vt → per-instance Terminal rendering into a pixel buffer</title>
<updated>2026-08-17T18:28:48Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-17T18:28:48Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=7bd3459f4f8bae69509202e5aa0dbd04a42c656f'/>
<id>urn:sha1:7bd3459f4f8bae69509202e5aa0dbd04a42c656f</id>
<content type='text'>
- Refactor vt.rs into a per-instance Terminal struct (owned cell/rendered
  grids, cursor, ANSI parser, scroll state), rendering glyphs into a
  caller-owned pixel buffer with dirty-region blitting
- Add gop buffer primitives (buffer_glyph_px, buffer_shift_up) and keep
  the legacy vt:: API as thin wrappers around the home terminal
- Remove the now-obsolete scroll hook and shadow scroll path
- Home terminal renders into its own buffer; window_id stays None until
  the WM integration lands
</content>
</entry>
<entry>
<title>wm: keep windows in place when the console scrolls beneath them</title>
<updated>2026-08-17T17:08:47Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-17T17:08:47Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=f4fab5a2b06c37df08d2d315bcb44d15af1786a4'/>
<id>urn:sha1:f4fab5a2b06c37df08d2d315bcb44d15af1786a4</id>
<content type='text'>
The console's batched scroll (gop::shift_up_n) shifts the whole shared
shadow, which dragged any composited window pixels up with it.  Add a
scroll hook so the window manager re-composites every visible window
after a console scroll, restoring them at their fixed positions.
</content>
</entry>
<entry>
<title>wm: title-bar drag-to-move; stop delivering title-bar gestures to apps</title>
<updated>2026-08-17T16:58:06Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-17T16:58:06Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=0e405aad6bc9f631b9b7a766fb1147fef943f492'/>
<id>urn:sha1:0e405aad6bc9f631b9b7a766fb1147fef943f492</id>
<content type='text'>
- Track the active mouse gesture (none / window-move / app-stroke) so a
  press on the title bar becomes a move drag instead of leaking Move
  events into the app's content
- Add move_window (clamped to the canvas, repaint old + new regions)
- Always deliver MouseKind::Release so a stroke that ends outside the
  window still terminates
</content>
</entry>
</feed>
