Introduce boot.mgr - a self-registering, dependency-ordered boot initialization framework with barrier-based phasing and glob pattern matching. Units now declare their own init procedures and dependencies via registerBoot()/registerBarrier() in their initialization sections, boot.mgr.run() topologically sorts and executes them. - Add src/boot/boot.mgr.pas with topoSort, glob matching, barrier two-pass algorithm, and boot tree printer - Gut src/asuro.pas (kmain): now just stores multiboot info, calls System.init(), boot.mgr.run, and yield() - Add initialization sections with registerBoot() to 53 existing units - Add new units: core.pas, test.pas, driver.storage.boot.pas, app.wasm.pas, app.bsod.pas (factored out of asuro.pas) - Define 9 barrier phases: immediate -> early -> middle -> storage -> bus -> device -> bus.late -> late -> final - Fix xHCI ISR: exclude PRC/WRC from PORTSC change bit clearing to prevent race with port reset busy-wait - Fix driver.bus.usb.core fire_completion_hooks: guard against uint32 underflow when CompletionHookCount = 0 - Move auto_mount_volumes from device barrier to late barrier so it runs after PCI scan discovers storage controllers - Add toolchain/compile_initcalls.sh for boot entry extraction - Add Boot Registration sections to all 51 doc files; create 4 new doc files; rewrite boot.mgr.md; update mkdocs.yml nav
1.9 KiB
driver.storage.ctl.usb
USB Mass Storage Class driver stub.
Overview
This unit registers a USB class driver with the driver manager (driver.mgr) to claim USB Mass Storage Class interfaces (class $08, subclass $06 SCSI, protocol $50 Bulk-Only). When the USB stack enumerates a matching interface, the load callback is invoked. Currently the callback only logs a detection message; no I/O infrastructure is established.
Full Bulk-Only Transport (BOT) support — including Max LUN query, endpoint setup, CBW/CSW command exchange, and driver.storage.mgr device registration — is planned but not yet implemented.
Boot Registration
Registered with boot.mgr as driver.storage.ctl.usb at the device barrier. The barrier order places device after bus, ensuring driver.bus.usb.core.init has run before the storage class driver registers with the driver manager.
Dependencies
-
boot.mgr -
driver.mgr -
memory.heap -
driver.storage.types -
io.syslog -
debug.tracer -
driver.bus.usb.core -
driver.bus.usb.types -
core.util,arch.x86.util
Constants
| Constant | Value | Description |
|---|---|---|
USB_CLASS_MASS_STORAGE |
$08 |
USB interface class for mass storage |
USB_SC_SCSI |
$06 |
SCSI transparent command set subclass |
USB_PROTO_BBB |
$50 |
Bulk-Only (BOT) transport protocol |
Functions and Procedures
init
procedure init;
Constructs a TDeviceIdentifier matching any USB device with bInterfaceClass = $08, bInterfaceSubClass = $06, bInterfaceProtocol = $50, and registers the load callback with driver.mgr.
Notes
- The
loadcallback currently returns true unconditionally after logging a detection message. - Once full BOT support is implemented,
loadshould query the Max LUN, allocate endpoint structures, and calldriver.storage.mgr.register_devicefor each logical unit.