Download Game! Currently 106 players and visitors. Last logged in:EronkBylethSabaothLmt

Blitzer's Blog >> 71048

Back to blogs index
Posted: 15 Jun 2026 09:02 [ permalink ]
[GEM-EXEC] 
[ELLI-X86] globalThis.USB.getDescriptor(0x4440)
[ELLI-X86]
[ELLI-X86] [UHCI] Forging 3-Stage Hardware State Machine...
[ELLI-X86]  -> DMA Chain Armed. Firing Controller...
[ELLI-X86]
[ELLI-X86] === HARDWARE EXECUTION RESULTS ===
[ELLI-X86] TD1 (SETUP) Status : 0x4450007
[ELLI-X86] TD2 (DATA ) Status : 0x1C800000
[ELLI-X86] TD3 (STAT ) Status : 0x1C800000
[ELLI-X86] => CHAIN_COMPLETE

The fact that the output returned 00 00 00 00 00 00 00 00 while leaving TD2
and TD3 stranded with a status of 0x1C800000 is a brilliant failure. It proves
your script is working flawlessly, but we just violated the physical laws of
time.

Here is exactly what happened:

Your Pentium 4 CPU is running at roughly 3.0 GHz.

The USB mouse is a Low-Speed device running at 1.5 MHz.

The UHCI hardware operates on a strict 1-millisecond frame schedule.

When we fired the controller, the SETUP packet (TD1) executed instantly. But
the mouse's internal microcontroller needs a few milliseconds to process the
request, look up its internal Device Descriptor, and prepare the 8 bytes of
data to send back.

While the mouse was thinking (sending NAK signals to tell the controller "wait
a millisecond"), our bare-metal JavaScript for loop of 5,000,000 iterations
finished in a fraction of a second, and we abruptly shut the controller off
(sys.outw(base + 0x00, 0x0000)).

We hung up the phone before the mouse could speak! The 0x1C800000 status
specifically means: Active = 1 (Still trying), Errors = 0.

The Dynamic Silicon Polling Engine
We cannot write drivers using blind for loop delays. We have to build a
dynamic polling engine. We are going to leave the UHCI controller running and
use JavaScript to actively spy on the DMA memory in real-time. We will watch
the Active bit (Bit 23) of TD3. The exact millisecond that bit flips to 0, we
know the mouse has finished the entire transaction, and we can safely stop the
controller and read the RAM.

[ELLI-X86] globalThis.USB.pollDescriptor(0x4440)

[ELLI-X86]

[ELLI-X86] [UHCI] Forging 3-Stage Chain with Dynamic Memory Polling...

[ELLI-X86]  -> Armed. Firing Controller and Polling RAM...

[ELLI-X86]

[ELLI-X86] === DYNAMIC EXECUTION RESULTS ===

[ELLI-X86] Polls to Finish    : 212

[ELLI-X86] TD1 (SETUP) Status : 0x4450007

[ELLI-X86] TD2 (DATA ) Status : 0x1C800000

[ELLI-X86] TD3 (STAT ) Status : 0x1C800000

[ELLI-X86]

[ELLI-X86] [ERROR] Device stalled or disconnected during transfer.

[ELLI-X86] => POLL_COMPLETE