OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 5:07 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to start with developing UHCI?
PostPosted: Tue Aug 27, 2019 11:57 am 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
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/blob/master/source/drivers/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.

_________________
https://github.com/VendelinSlezak/BleskOS


Top
 Profile  
 
 Post subject: Re: How to start with developing UHCI?
PostPosted: Fri Aug 30, 2019 2:22 pm 
Offline
Member
Member

Joined: Tue Aug 30, 2016 1:31 pm
Posts: 69
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.


Top
 Profile  
 
 Post subject: Re: How to start with developing UHCI?
PostPosted: Fri Aug 30, 2019 2:30 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
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.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: How to start with developing UHCI?
PostPosted: Thu Sep 05, 2019 7:58 am 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
Thank for answers!

_________________
https://github.com/VendelinSlezak/BleskOS


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 74 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group