<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rs-dos/shell/src, 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-27T15:34:10Z</updated>
<entry>
<title>GUI: fire-and-forget spawn for /bin/gui binaries</title>
<updated>2026-08-27T15:34:10Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-27T15:34:10Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=81fee80d8aaf6ee6b95ca20a30eac5d0a41d4d79'/>
<id>urn:sha1:81fee80d8aaf6ee6b95ca20a30eac5d0a41d4d79</id>
<content type='text'>
exec_external now tries CLI first (blocking), then GUI (fire-and-forget).
GUI binaries spawn as tasks and return immediately — the shell continues
to the next prompt while the binary runs its own event loop.  Exit is
handled by the scheduler (task cleanup on death), not by waiting on a
completion message.

bins/paint staged at /bin/gui/paint.efi on the system image.
All 11 tool binaries + 3 gate binaries (hello, boom, count) verified
across the v2 ABI.  test-disk regression passed on the same kernel.
</content>
</entry>
<entry>
<title>GUI: window/event exports, paint binary, event-loop gate</title>
<updated>2026-08-27T15:23:34Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-27T15:23:34Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=ba304898b8e177d90afb58d201b4c3dd3c927c48'/>
<id>urn:sha1:ba304898b8e177d90afb58d201b4c3dd3c927c48</id>
<content type='text'>
rsapi: WmEvent (kind=u8 enum: 0=key, 1=mouse, 2=focus, 3=close),
WmKeyKind (Char/Enter/Backspace/F1-F4/…), WmMouseEvent (x/y/buttons),
WindowInfo (ptr/w/h).  Five new exports: wm_create, wm_buffer,
wm_flush, wm_destroy, wm_recv (non-blocking TaskMsg dispatch → WmEvent).

Shell: abi_wm_* wrappers bridge rsapi types to rsnix::wm and
sched::recv(); wm_recv translates TaskMsg::Key/Mouse/Focus/Close
into flat WmEvent union.

bins/paint: gate binary — create_window + buffer + event loop with
Bresenham line drawing, color select (1-8), clear (c), F4 close.
All via wm_* ABI exports.

Fully migrated: date, mem, pci, cat, ls, mkdir, touch, rm, klog,
info, paint (11 external binaries in /bin/cli/ + 3 gate binaries).
</content>
</entry>
<entry>
<title>tool migration: v2 exports + 10 external CLI binaries</title>
<updated>2026-08-27T15:16:04Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-27T15:16:04Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=8767dbecb45bbe5f748952fb9171b1a96c173f67'/>
<id>urn:sha1:8767dbecb45bbe5f748952fb9171b1a96c173f67</id>
<content type='text'>
rsapi v2: 14 new ABI function pointers appended after v1 — fs_resolve,
fs_dir_next (iterator), fs_create, fs_remove, fs_read, fs_write,
fs_size, fs_close, rtc_now, mem_stats, pci_probe, pci_device,
klog_dump, kernel_version.  New C-repr structs: DirEntry, RtcTime,
MemStats, PciDevice, KernelVersion.  ABI_VERSION bumped to 2.

Shell-side: build_exports() constructs the full table at runtime per
invocation (replaces static const).  14 kernel-side wrapper functions
bridge rsapi types to rsnix kernel APIs; fs_dir_next maintains a
per-handle cache of children() results for iteration.

Tool binaries (10 crates, all linked against rsapi only):
- date: rtc_now → formatted YYYY-MM-DD HH:MM:SS
- mem: heap/pages free/total via mem_stats
- pci: pci_probe + pci_device enumerate all devices
- cat: fs_read paths or get_line stdin; put_line output
- ls: fs_resolve + fs_dir_next iteration; trailing / for dirs
- mkdir: fs_create(path, true)
- touch: fs_create(path, false)
- rm: fs_remove(path)
- klog: klog_dump 2048 bytes → put_line
- info: rtc_now + kernel_version (minimal; mem/pci deferred)

Gate verified: date prints RTC; pci lists all 4 QEMU devices
(8086:29c0, 1234:1111, 8086:10d3, 8086:2918); hello/boom/count
still work; test-disk PASS; poweroff clean.
</content>
</entry>
<entry>
<title>streams: per-invocation channel, pumping mode, filter pipeline wiring</title>
<updated>2026-08-27T14:58:31Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-27T14:58:31Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=300c0acbd7ab3fae8596ff839c39d9a17c70c68d'/>
<id>urn:sha1:300c0acbd7ab3fae8596ff839c39d9a17c70c68d</id>
<content type='text'>
exec: LineChannel bounded ring (cap=16) with abort/eof/marker fields.
Shell 'pumping mode' assembles canonical lines from its queue into the
channel while the command runs; ^C marks the channel aborted.

Shell-side grammar: USE/TIL pre-drain into the channel before spawn;
&lt;cmd&gt; &lt;path&gt; TIL &lt;marker&gt; sugar drains paths until the marker line.
Interactive TIL: pump_key checks each submitted line against the marker
and closes the channel when it matches.

Exports callbacks run in the command task but touch shell-owned state:
this is safe by construction — the shell blocks in exec_external until
the command completes.  put_line feeds Pipeline::line directly;
get_line pops from the channel (yield-poll when empty).

load: drop NX from image mapping (single-privilege kernel, NX bit 63
reserved when EFER.NXE is set by OVMF); compute image span from section
RVAs not file size.

bins/count: gate binary — reads lines via get_line, reports count via
put_line.  Verified: count USE file → 6; count &lt;path&gt; TIL END → 2;
interactive count TIL DONE → 3; -h filter across task boundary;
^C abort.

v1 stream exports: put_line → Pipeline, get_line ← channel, log_line
→ klog append, exit → abort_current.

Accounting: print_one_line → pipe.line() returns false (head kill /
pager ^C) → the binary should wrap up promptly; accepted: binary does
not check the return value in v1 (phase 3 simplification).
</content>
</entry>
<entry>
<title>exec: PE32+ loader, versioned ABI, first external binaries (v0.6.0)</title>
<updated>2026-08-21T19:17:44Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-21T19:17:44Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=71b6445b048456bf198d8b622570db95f4665cb9'/>
<id>urn:sha1:71b6445b048456bf198d8b622570db95f4665cb9</id>
<content type='text'>
rsapi: the kernel&lt;-&gt;binary ABI crate (no_std, no deps).  Versioned
Exports table (magic + version header), EntryPoint = extern "C" on
x86_64-unknown-uefi (Win64: RCX/RDX/R8), Line/Arg/StreamResult types.
Binaries link only this crate.

rsnix::load: PE32+ parser — DOS/COFF/optional headers, section copy,
BSS zero-fill, .reloc base relocations (DIR64) via rva_to_file mapping
(the reloc directory is an RVA, not a file offset).  Images are
allocated at LOAD_BASE=192MiB inside the page allocator's conventional
span and identity-mapped user+writable+nx.

rsnix::exec: resolution name -&gt; /disk/&lt;UID&gt;/bin/&lt;kind&gt;/&lt;name&gt;.efi per
mounted volume; spawn reserves a sched slot, stores a per-task ExecCtx
(exports + argv block + image) before launch_at installs the frame —
no adopt race.  Trampoline calls entry(&amp;Exports, argc, argv), posts
TaskMsg::User(exit_code) to the shell.  abort_current notifies the
shell with u64::MAX when an exec'd binary dies, so a faulting command
cannot leave the shell blocked forever.

sched: reserve_slot/launch_at split out of spawn; task_exit made pub.

shell: exec_external runs before non-frozen built-ins (ADR 0006
resolution rule); frozen core (help/clear/echo/halt/poweroff/exit/
rescan) is exempt.  Exports v1 wires put_line to the terminal and
get_line to EOF; stream injection lands in Phase 3.  ^C while waiting
kills the command task.

bins/{hello,boom}: gate binaries.  hello prints through the exports
table; boom faults on 0x400000000000 to prove containment.  The image
entry point IS the ABI entry (efi_main carries the Exports signature).

Version 0.6.0: exec exists end-to-end.

Gates verified in QEMU: 'hello' loads from \\bin\\cli\\hello.efi, calls
put_line across the ABI, exits 0, shell unblocks; 'boom' faults, task
dies gracefully with full report, shell survives, jobs shows the corpse;
built-in fallback works when the file is absent; test-disk PASS.
</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>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>
</feed>
