<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rs-dos/rsnix/src/tty.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-08-21T18:13:59Z</updated>
<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: 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>wm: flush terminal window content on gaining focus</title>
<updated>2026-08-21T01:32:07Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-21T01:32:07Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=956093be4f3b7a0fe86a523e5f9d9e74b9a77e59'/>
<id>urn:sha1:956093be4f3b7a0fe86a523e5f9d9e74b9a77e59</id>
<content type='text'>
focus() only composites the title bar — the window content stays
stale until the next write.  Call term.flush() on Focus(true) so
the full window is re-composited immediately when switching to 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>Windowed GUI: wm module, input routing, and the paint app</title>
<updated>2026-08-17T16:56:04Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-17T16:56:04Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=5558e3509d020a0e021a77f0617044497b2f2aee'/>
<id>urn:sha1:5558e3509d020a0e021a77f0617044497b2f2aee</id>
<content type='text'>
- Add the wm window-manager facility per ADR 0004: overlapping
  pixel-surface windows, damage-rectangle compositing, WM-drawn title
  bar, focus/minimize/close, and F1-F4 keybindings
- Add gop shadow compositing primitives and vt::repaint_region so the
  console stays layer 0 beneath windows
- Route mouse (absolute coords, press/release edges) and keyboard
  (focus-aware input pump) to the focused window
- Add the rspaint drawing-program crate (pen, 8 colors, clear) and shell
  draw/windows/restore commands
- Extend TaskMsg with AppMouse/Focus/Close and document the design in
  CONTEXT.md + ADR 0004
</content>
</entry>
<entry>
<title>USB2/1.1 (EHCI/UHCI) drivers + real-hardware bring-up hardening</title>
<updated>2026-08-17T12:53:52Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-17T12:53:52Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=be868a43185826b02bf6d091019bb779678525bb'/>
<id>urn:sha1:be868a43185826b02bf6d091019bb779678525bb</id>
<content type='text'>
- Add polled EHCI (USB2) and UHCI (USB1.1) host-controller drivers with
  HID boot mouse support, wired into cursor polling and the 'usb' shell cmd
- Add USB Legacy ownership handoff (claim_usb_legacy) plus config_write_byte
- Harden boot: verify the PIT/timer ticks before shell entry, EOI stray
  interrupts in the LAPIC to stop interrupt storms, bound PS/2 controller
  waits, and INTx-disable AHCI (polled driver)
- Add boot stage markers, klog screen echo, and QR lock; scheduler
  mark_shell_running; NO_USB stopgap to keep BIOS USB-Legacy input alive
- alloc_pages_above for DMA buffers that must avoid low conventional memory
- Expand DEBUG_NOTES with EHCI/QEMU bring-up findings
</content>
</entry>
<entry>
<title>klog/tty/pager: no more truncated lines — full lines flow, terminal wraps</title>
<updated>2026-08-01T16:03:20Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-01T16:03:20Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=c2b6daeaaf1da5c6f81300e954f2b3592c0668c0'/>
<id>urn:sha1:c2b6daeaaf1da5c6f81300e954f2b3592c0668c0</id>
<content type='text'>
- klog: MAX_LINE 128 -&gt; 512 (lens widened u8 -&gt; u16) — long serial_println
  lines (panics, boot messages) are no longer cut at 128 bytes; they
  print in full and the terminal wraps them at the screen edge
- tty: LINE_BUF_SIZE 256 -&gt; 1024 — typed command lines longer than 256
  chars were silently dropped at the buffer limit; now they echo and
  submit in full (the terminal already wraps the echo mid-typing)
- pager (-p): screenfuls now count wrapped rows, not lines — a line
  wider than the terminal occupies ceil(len/cols) rows, so the pause
  lands at a real screen boundary instead of overflowing it
</content>
</entry>
<entry>
<title>Clean up warnings, fix FAT32 multi-cluster dirs, prep for edition 2024</title>
<updated>2026-08-01T01:44:57Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-01T01:44:57Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=63d01e9d8eb6f3ccb6a96b7c577834276cf51add'/>
<id>urn:sha1:63d01e9d8eb6f3ccb6a96b7c577834276cf51add</id>
<content type='text'>
Warning cleanup (cargo check + clippy now 0 across the workspace):
- Migrate all 21 static_mut_refs sites to &amp;raw mut accessors (fat, gop,
  ps2, vt, ahci, interrupts, memory) so edition 2024 won't deny them
- panic = "abort" profiles: bare cargo check/build now works without
  nightly/-Zbuild-std
- Wire TICKS in the timer ISR (it was never incremented, so the vt scroll
  batching trigger was dead code)
- Clippy: efi_main becomes unsafe extern "efiapi" with a # Safety doc,
  KeyBuf::new uses inline-const array repeat (no interior-mutable const),
  editor main loop is a while-let, PIT control byte regrouped
- [workspace.lints.clippy] allows result_unit_err + needless_range_loop
  (deliberate kernel style); large_enum_variant allowed on LineInput
- Drop now-stale static_mut_refs allow from the rsdos bin

FAT32 correctness fixes (both pre-existing, exposed by the SFN fix):
- Unique 8.3 short names: to_8_3() never disambiguated collisions, so
  files sharing a long-name prefix got identical SFNs and fsck reported
  duplicate directory entries.  Add dir_short_names() + unique_short_name()
  (~N tails, Windows-style) and force LFN when the SFN changes.
- Multi-cluster directories: scan_dir/dir_short_names stopped at the first
  0x00 slot, hiding every entry written into a chained cluster (writes
  failed with 'cannot write', duplicate SFNs accumulated); add_dir_entry
  now packs the cluster (0xE5 deleted-markers) before extending so other
  FAT readers (mtools, Windows) see the continuation too.

Other: delete dead fields (Disk.fis, Volume.fat_count), drop timer_irq/
keyboard_irq/rendered, refresh_and_exit is a documented unsafe fn, CONTEXT
.md corrected (stable toolchain, IRQ input, 4-crate layout), .gitignore
excludes .pi-subagents artifacts.

Validated: cargo check/clippy/fmt clean, make test-disk PASS on fresh and
reused images (incl. two directory-chain extensions and ~10 SFN tails),
editor round-trip smoke test PASS.
</content>
</entry>
<entry>
<title>vt: defer scrolls and batch framebuffer pushes</title>
<updated>2026-07-31T16:08:45Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-07-31T16:08:45Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=075c87d52a4d90c0f00f8ba7ba849677771a9be3'/>
<id>urn:sha1:075c87d52a4d90c0f00f8ba7ba849677771a9be3</id>
<content type='text'>
Streaming output scrolled one framebuffer push per line (each a
~3-8 MB write-only copy).  The vt now scrolls the logical grid
instantly in RAM and defers the display shift: N pending scrolls are
pushed together as one shift_up_n — one push regardless of batch size.

- vt: PENDING_SCROLLS counter; scroll_up shifts CELLS only; flush
  renders nothing while pending (the diff would otherwise re-rasterise
  the whole screen per line); sync_scroll() does one gop::shift_up_n +
  RENDERED mirror + normal diff flush (which re-blits just the newly
  exposed rows and the cursor).
- Sync triggers: batch of 16 rows, ~40 ms of stream pause (100 Hz
  TICKS), any CSI sequence (full-screen apps like the editor render
  immediately), clear_all/set_cursor_visible, interactive input
  (tty read_line/read_byte), and the shell before each prompt.
- gop: shift_up → shift_up_n(n) (one shadow memcpy + one push).

Verified in QEMU: mmap/hexdump streaming renders in coherent batches
with the prompt syncing at the end; clear wipes clean; the editor
scrolls and redraws immediately (45-line file, gutter + status bar
intact, cursor correct); save/exit/cat round-trip unchanged.  Release
and dev builds pass.
</content>
</entry>
</feed>
