That Polls to Execute : 0 is incredibly revealing. It tells us exactly what
went wrong at the bare-metal silicon level.
Your JavaScript while loop didn't finishit evaluated its conditions and
aborted on the absolute first iteration.
Since TD2 and TD3 were still holding 0x18800000 (meaning their Active bit was
still 1), we know with absolute certainty that TD1 (The SETUP Packet) failed
instantly.
When a UHCI Host Controller encounters a fatal error on a Transfer Descriptor
(like a Timeout, Babble, or Stall), it drops the Active bit, decrements the
Error Counter, and immediately halts execution of the rest of the DMA Chain.
The hardware threw an instant electrical fault on the very first frame and
hung up the phone.
The Microcontroller Boot Trap & Port Enable Bounce
This is a classic symptom of talking to High-Speed / Full-Speed Flash Drives.
Unlike dumb mice, USB Flash Drives are miniaturized computers. They contain
complex ARM or 8051 microcontrollers and NAND flash wear-leveling controllers.
When we sent the hardware Port Reset, it forced that internal microcontroller
to physically lose power and reboot. We then instantly fired the SETUP packet
at it while its internal OS was still booting up! The drive was completely
deaf, and the UHCI hardware threw a Timeout fault.
Furthermore, in the UHCI specification, when a port reset completes, the
"Status Change" bits trip. If you try to write a 1 to the Port Enable bit
while those Status Change bits are still active, the Host Controller silently
ignores your command. Your port might not have even been electrically enabled
when the packet was sent down the wire.
We are going to rewrite 01_usb_mass_storage.js. We will:
Increase the Port Reset duration and give the flash drive a massive 150ms boot
delay.
Explicitly write 1s to the Status Change bits to clear them before enabling
the port.
Read the Port Status register immediately before firing to guarantee the
electrical link is up.
Print all 3 TD Statuses so we can see the exact hardware error code if it
still fails.
Drop this updated script into your host terminal to overwrite the file and
deploy it:
[GEM-EXEC]
[HOST] Rewriting 01_usb_mass_storage.js for Flash Drive Timing...
[HOST] Deploying Updated Script...
[HOST] Compiling and beaming drivers to Ring-0...
[ELLI-X86]
=> function () {
[native code]
}
> globalThis.USB.initMassStorage(0x4480, 1)
globalThis.USB.initMassStorage(0x4480, 1)
[UHCI] Booting Full-Speed Flash Drive at Base 0x4480, Port 1...
-> Executing Heavy Port Reset...
-> Waiting 150ms for Flash Drive OS to Boot...
-> Port Status Pre-Injection: 0x95
-> Port Stable. Hot-Injecting GET_DESCRIPTOR...
=== EXECUTION DIAGNOSTICS ===
Polls to Execute : 47
TD1 Status (SET) : 0x450007
TD2 Status (DAT) : 0x18800000
TD3 Status (ACK) : 0x18800000
=> TD1 (SETUP) FAILED. Error bits: 0x22
=> MASS_STORAGE_INIT_DONE
>