I am working on a PC system diagnostic software running in DOS, the aim is to scan the motherboard and display the information about hardware and peripheral devices. I use the HP USB format tool and FreeDOS system files to make a bootable USB stick, the diagnostic software run from this bootable USB stick. I just read the descriptor from UHCI controller, below is the method I used:
1.Scan UHCI controller to find the PCI bus, dev, fun and io_address, port status for the USB stick
2. allocate 4K frame address (4K alignment), write Frame Base address register, Frame Number set to 0
3. build the QH and TDs for getting device descriptor
QH --> SetupTD (maxlen = 7, data0, endpoint 0, address 0, PID=SETUP, IOC 0)
--> TD0 (maxlen = 7, data1, endpoint 0, address 0, PID=IN, IOC 0)
--> TD1 (maxlen = 7, data0, endpoint 0, address 0, PID=IN, IOC 0)
--> TD2 (maxlen = 7, data0, endpoint 0, address 0, PID=IN, IOC 0)
--> TD3 (maxlen = 7FFh, data1, endpoint 0, address 0, PID=OUT, IOC 1) (Terminate)
4. Write the physical address of QH to frame list 0
5. enable all interrupts, set HC run
6. wait for interrupt happen,
7. mask all frame list as terminated, finsih reading USB device descriptor.
But the return descriptor is EMPTY, I want to know whether the method I used is right or not, thank you!