That makes sense. Okay, I will have a look and see what I can find.Bonfra wrote:Sorry i didn't specify, the OS only knows how to read from sata ahci drives for the moment.
anyway the USB thing should happen before it tries to load the init process (actually even before the successfully booted message), so something more should appear if a controller with something attached is found
Different transfer type using uhci
Re: Different transfer type using uhci
Re: Different transfer type using uhci
Thanks a lot! I really appreciate what you are doing for me :)
Just don't get too busy with this rn, it still is Christmas XP
Just don't get too busy with this rn, it still is Christmas XP
Regards, Bonfra.
Re: Different transfer type using uhci
Indeed, and a Merry Christmas to you as well.Bonfra wrote:Thanks a lot! I really appreciate what you are doing for me :)
Just don't get too busy with this rn, it still is Christmas XP
I spent a few minutes and was able to run your image through my USB Test Suite after finding a few errors.
1) The read at:
https://github.com/Bonfra04/BonsOS/blob ... uhci.c#L51
is trying to read a WORD when the register is a BYTE. QEMU seems to allow it, Bochs does not. Your UHCI code returned 'UHCI not detected' and did nothing more.
2) When setting the interface, you need to use USB_REQUEST_RECP_INTERFACE as well
https://github.com/Bonfra04/BonsOS/blob ... uest.c#L75
(For now, you can ignore setting the interface. When you find a device that supports more than one interface (BBB and UASP for example), you will then need to set the interface)
3) Unlike IN packets, when sending OUT packets (Bulk or otherwise), you should send the count of bytes being sent, not the max count.
https://github.com/Bonfra04/BonsOS/blob ... sfer.c#L80
All but that last packet should have a count of MAX_PACKET, then the last packet has the remaining. Since your first try is a CBW, it is only one packet with 31 bytes. You currently tell it you are sending 64. It will STALL.
Your code should be something like:
Code: Select all
packets[pid].maxlen = (size > MAX_PACKET) ? MAX_PACKET : size;
size -= MAX_PACKET;
After modifying my test suite to allow these errors, I got your code to retrieve 36 bytes of Inquiry data (though I did not verify that it was correct data) and retrieve a 13-byte CSW.
Again, Merry Christmas to you and everyone here.
Ben
Re: Different transfer type using uhci
It works awesomely! The SCSI output is correct and I can successfully read from the drive. Thanks a lot!
Now I'm having some troubles making this work on real hw, but it's a problem for another day, I'm happy with these results. Thanks again and merry Christmas :)
Now I'm having some troubles making this work on real hw, but it's a problem for another day, I'm happy with these results. Thanks again and merry Christmas :)
Regards, Bonfra.