diff options
| -rw-r--r-- | CONTEXT.md | 36 |
1 files changed, 36 insertions, 0 deletions
| @@ -294,6 +294,42 @@ Workspace of four crates, all built for the `x86_64-unknown-uefi` target: | |||
| 294 | temporary 140-line boot loop (128 kept / 40 dropped, seq 40..167, | 294 | temporary 140-line boot loop (128 kept / 40 dropped, seq 40..167, |
| 295 | oldest live line correct — loop reverted after the test). | 295 | oldest live line correct — loop reverted after the test). |
| 296 | 296 | ||
| 297 | ✅ **Runtime device detection (hotplug rescan)** — the boot discovery | ||
| 298 | pipeline is now re-runnable and diffed against live hardware: | ||
| 299 | |||
| 300 | - `ahci`: stores ABAR/port bitmap; `poll_dirty()` is a cheap per-port | ||
| 301 | `PxSSTS.DET == 3` probe (safe on every prompt), `rescan()` starts | ||
| 302 | newly-present ports (full `start_port` bring-up) and tombstones | ||
| 303 | slots of removed ones. **Slots never shift** — indices stay stable | ||
| 304 | so VFS disk handles and `ACTIVE` selection keep working; `select()` | ||
| 305 | rejects tombstones. | ||
| 306 | - `fat`: `Volume` gains a `mounted` flag; `rescan()` unmounts volumes | ||
| 307 | whose disk left and mounts every disk without a mounted volume | ||
| 308 | (which also re-tries mounts that failed at boot, e.g. a non-FAT | ||
| 309 | disk replaced by a FAT one). UID dedup ignores tombstones, so a | ||
| 310 | re-plugged disk keeps its `/disk/<UID>` name. | ||
| 311 | - `fs`: the init mount loop is factored into `rescan_disks()`, which | ||
| 312 | lazily creates `/disk`, ensures a mount node per mounted volume and | ||
| 313 | tombstones nodes of unmounted ones — `cat /disk/<gone>/…` fails | ||
| 314 | cleanly with "no such file". | ||
| 315 | - shell: `rescan` command plus an automatic deep rescan before each | ||
| 316 | prompt whenever `poll_dirty()` sees a change; a one-line summary | ||
| 317 | reports added/removed counts. All rescan events flow through | ||
| 318 | `serial_println!` so they land in klog (`ahci: port N up`, `fat: | ||
| 319 | mounted …`) — the boot log doubles as a device log. | ||
| 320 | |||
| 321 | **QEMU testability reality (verified)**: PCIe ADD works end-to-end | ||
| 322 | (`-device pcie-root-port,id=rp1` at boot, monitor `device_add | ||
| 323 | e1000e,bus=rp1` → the kernel's `pci` re-scan sees it; q35 root bus | ||
| 324 | itself rejects hotplug, root ports are required). Disk hotplug is | ||
| 325 | **not** QEMU-modelable: the ich9-ahci's IDE buses refuse | ||
| 326 | `device_add ide-hd` ("Bus 'ide.N' does not support hotplugging") and | ||
| 327 | `drive_add if=ide` ("Can't hot-add drive to type 1"); PCIe | ||
| 328 | `device_del` is a guest-cooperative protocol (the device stays in | ||
| 329 | config space until the guest powers off the slot), so removal is | ||
| 330 | also untestable in QEMU. The disk arrival/removal path (PxSSTS | ||
| 331 | based) is verified on real hardware instead. | ||
| 332 | |||
| 297 | ## Known issues / perf notes | 333 | ## Known issues / perf notes |
| 298 | 334 | ||
| 299 | - **Scroll cost** — scrolling still shifts the whole framebuffer (a | 335 | - **Scroll cost** — scrolling still shifts the whole framebuffer (a |
