Good day!
I want write driver for USB and I want start with UHCI. But I have problem. I dont know where I should start. OsDev, LowLevel and BenLunt USB book contain many informations and I dont know how it use. My code for UHCI interface is here: https://github.com/Klaykap/LightningOS/ ... usb_uhci.c but I dont know how start initalize usb and do transfers.
Please where I can found "first step with USB"?
Please how is right initalization of usb port?
I thank you in advance.
How to start with developing UHCI?
Re: How to start with developing UHCI?
I had the same problem.
first you stop the controller by turning the running bit on 0. (at USBCMD)
then you call a reset by turning the reset bit on 1 (at USBCMD)
then you wait, and turn the reset bit off again.
then you fill all the registers with how you want to have it, then you put the running bit on again (USBCMD).
now it should detect usbsticks. on emulators he does this but on real hardware im not able to make it work yet.
first you stop the controller by turning the running bit on 0. (at USBCMD)
then you call a reset by turning the reset bit on 1 (at USBCMD)
then you wait, and turn the reset bit off again.
then you fill all the registers with how you want to have it, then you put the running bit on again (USBCMD).
now it should detect usbsticks. on emulators he does this but on real hardware im not able to make it work yet.
Re: How to start with developing UHCI?
https://lmgtfy.com/?q=uhci+design+guide&p=1&iie=1
The spec tells you exactly which bits to set and how long to wait for the reset. As for transfers, you will have to read up on the Frame List. Essentially, you create a TD pointing to the buffer required, then tell the UHCI to run and wait for the frame to get sent or received.
The spec tells you exactly which bits to set and how long to wait for the reset. As for transfers, you will have to read up on the Frame List. Essentially, you create a TD pointing to the buffer required, then tell the UHCI to run and wait for the frame to get sent or received.
Carpe diem!