<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rs-dos/rsnix/src/klog.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-17T12:53:52Z</updated>
<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>rsnix: preemptive kernel tasks (ADR 0003) — sched, IST fault stacks, 176-byte frames</title>
<updated>2026-08-01T15:38:57Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-01T15:38:57Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=8f05ea44f69cb796e7b1f581ba1b8045c98d615b'/>
<id>urn:sha1:8f05ea44f69cb796e7b1f581ba1b8045c98d615b</id>
<content type='text'>
- sched: 16-slot static table, shell=task 0, idle=task 1, spawn with
  guard page + 8 KiB stack, RR on the 100 Hz tick, int 0x60 yield,
  sleep_ms, lazy reap, jobs/bg/sleep/kill shell commands
- gdt: own GDT mirroring UEFI selectors + TSS with IST1/IST2
  (guard-page overflows die gracefully instead of triple-faulting)
- interrupts: isr_dispatch returns next frame in rax; IntFrame grows
  rsp/ss fields — QEMU's 64-bit iretq always pops all five slots from
  a 176-byte frame, so synthetic task frames must carry rsp=top+ss
  (a 160-byte frame made the first iretq pop rsp/ss from the unmapped
  page beyond the frame)
- panic handler: task panics abort the task, shell keeps running
- main: sched::init moved after page allocator + adopted tables
  (the idle's stack+guard need both; it was silently not spawning)
</content>
</entry>
<entry>
<title>klog: [ssss.mmm] millisecond timestamps from the PIT</title>
<updated>2026-08-01T12:21:11Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-01T12:21:11Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=6447eb12948d37b74adae2fdbf1db5a9d7b363d5'/>
<id>urn:sha1:6447eb12948d37b74adae2fdbf1db5a9d7b363d5</id>
<content type='text'>
- interrupts::uptime_ms(): monotonic ms since boot — the 100 Hz PIT
  tick (10 ms) plus interpolation from the PIT's live 1.19 MHz
  down-counter (read twice around the tick load; a count jump means a
  tick fired between reads) for true sub-ms resolution.  TICKS widened
  AtomicU16 -&gt; AtomicU64 (u16 wrapped after ~11 min).
- PIT_READY gates interpolation until interrupts::init configures the
  timer, so early-boot lines are deterministically [0000.000] instead
  of uninitialised-PIT noise; klog clamps timestamps monotonic.
- The CMOS RTC cannot provide milliseconds (1 Hz BCD device, seconds
  only) — millis come from the PIT.
- klog stores ms per line at append time; dump format is now
  '[0000.123] 000000  === rsnix boot ===' (user-specified format).

Verified in QEMU: first line [0000.000], Phase-2 lines show real
monotonic ms (fs: vfs ready at [0000.519], self-test [0000.524]),
per-dump monotonicity, boot.log persists timestamps, test-disk round
trip fsck-clean.
</content>
</entry>
<entry>
<title>klog: kernel log ring + /dev/klog + klog shell command</title>
<updated>2026-08-01T12:09:14Z</updated>
<author>
<name>salmonik</name>
<email>salmonik@tuta.io</email>
</author>
<published>2026-08-01T12:09:14Z</published>
<link rel='alternate' type='text/html' href='https://git.2137697.xyz/rs-dos/commit/?id=c7540c31d45dac68fa1852f5d25645d569b2da9d'/>
<id>urn:sha1:c7540c31d45dac68fa1852f5d25645d569b2da9d</id>
<content type='text'>
- rsnix/src/klog.rs: RAM ring of the last 128 serial log lines (128
  chars each), fed by serial_println! so every boot/low-level message
  is captured for free.  Sequence numbers per line, wrap/drop
  accounting; the ring never allocates (const-constructible static).
- /dev/klog char device; shell 'klog' is a thin alias for cat
  /dev/klog with the same filters/redirection, so 'klog -t 5',
  'klog -g fat' and 'klog WRITING /disk/.../boot.log' all work.
  klog rejects positional args (usage) and input keywords.
- Shell user-facing output (banner, prompt, term_print/term_println,
  pipeline sink, halt/poweroff) now writes to serial directly instead
  of through serial_println!, keeping echo/cat output out of the boot
  log (a streaming cat /dev/mem would otherwise wrap the ring).
- serial_println! macro hooks klog::append_fmt via format_args! (no
  alloc at call sites); klog::dump formats the log for the device.

Verified in QEMU: 28 boot lines captured (seq 0..27), shell output
absent from the ring, klog WRITING persists a boot log (mtype-checked),
wrap verified with a temporary 140-line boot loop (128 kept / 40
dropped, seq 40..167, oldest-live correct; loop reverted); full
test-disk round trip still fsck-clean.
</content>
</entry>
</feed>
