Artemis Milestone 2e: virtual USB thumb-drive hotplug test + block-layout decisions

Verified live on amd64: booted with the xHCI controller present but no USB
device attached (no Port Status Change at ok>), then hotplug-attached a
virtual USB thumb drive via QMP (usb-storage on xhci0.0, backed by
disk/usb-thumbdrive-test.img) and got an immediate port status change
event -- the real connect trigger Milestone 2e's PORTSC handling will
consume next.

Confirmed blk_subsys_attach_device() (src/block_subsystem.c) is already
the correct integration point for USB -- it already appends a new device
to the end of the existing LBN chain, matching the intended design.
Documented the remaining gaps: no blkio_usb.c backend yet, no hot-detach
path in the device chain yet.

Decided the on-drive layout for USB thumb drives: GPT-partitioned (unlike
artemis.img's whole-device StarForth header), ~1GB metadata partition +
remainder for blocks, 16GB reference drive size, sizing tentative. No GPT
parser exists in kernel code yet -- new prerequisite work for Milestone
2h/3, not blocking current 2e work.

disk/usb-thumbdrive-test.img added as a tracked test fixture, per this
repo's standing convention that virtual disk/thumb-drive images used for
testing are committed, not left in scratchpad.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HZ8kNoTuP63pbQtro4qvrm
This commit is contained in:
Robert Allan James
2026-08-22 09:49:15 -04:00
co-authored by Claude Sonnet 5
parent 9c8ad8f6ff
commit bb84eba7e3
6 changed files with 9086 additions and 1 deletions
+15
View File
@@ -56,5 +56,20 @@ successfully recognized disk, which gets flushed at shutdown. This is
expected bookkeeping, not a bug; revert it before committing rather than
carrying timestamp noise in git history.
- `usb-thumbdrive-test.img` — 64MB raw image backing a QEMU `usb-storage`
device attached to the xHCI controller's bus (`xhci0.0`) for Milestone 2e/
2h hotplug testing, added 2026-08-22. Not yet formatted with any
LithosAnanke/Artemis header — at this point in the driver's development
it only needs to exist as a backing store for a live Port Status Change
event; formatting comes once `blkio_usb.c` and `blk_subsys_attach_device()`
wiring exist (Milestone 2h).
**Convention, standing as of 2026-08-22: every virtual disk/thumb-drive image
used for testing — Artemis persistence disks above, and USB Mass Storage
backing images alike — lives in this directory and is a tracked, committed
file, never scratchpad.** This was already `artemis.img`'s convention;
`usb-thumbdrive-test.img` and any future USB test images follow the same
rule. Confirmed no `.gitignore` in this repo excludes `disk/*.img`.
These are regenerable QEMU raw disk images, not source — see
`.claude/ARTEMIS.md` for the storage model they exercise.
Binary file not shown.