USB on real hw

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
BenLunt
Member
Member
Posts: 934
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: USB on real hw

Post by BenLunt »

Bonfra wrote:I'm sorry I'm still not that proficient with SCSI I mistakenly assumed it was the same from the USB descriptor. So this is a specific length for SCSI, how do I get it? is it in the inquiry result or another specific command I must send?
Don't be confused here, I think nullplan is trying to tell you that the MPS you get from the DEVICE DESCRIPTOR is the MPS for the Control Pipe only. The Endpoints have their own MPS, usually 512 for full-speed MSD devices.
The MPS for the endpoint has nothing to do with the SCSI layer, it just so happens that the MPS is 512, the size of a standard sector.

However, don't assume the MPS is 512. You need to get this from the Endpoint Descriptor.

Ben
rdos
Member
Member
Posts: 3198
Joined: Wed Oct 01, 2008 1:55 pm

Re: USB on real hw

Post by rdos »

I use read10 and write10 in my USB mass storage drivers. I don't think there is any reason to issue larger requests than can be handled by those. A typical caching scheme will seldom or never issue requests for larger blocks, and the advantage of reading more blocks in the same request is insignificant. I think mainstream OSes probably use read10/write10, and then USB mass storage manifacturers don't see the point in implementing support for read12/write12, or other odd formats that re not used.
User avatar
BenLunt
Member
Member
Posts: 934
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: USB on real hw

Post by BenLunt »

rdos wrote:I think mainstream OSes probably use read10/write10, and then USB mass storage manifacturers don't see the point in implementing support for read12/write12, or other odd formats that re not used.
To second that thought, I can confirm that Win95 through Win10 use Read10/Write10. I tested with a 40Meg drive and a 2.0Gig drive.
For now, I think a 32-bit LBA is sufficient for any USB at this point in time. However, USB sticks with Terabytes of data may be just over the horizon.
Of course this doesn't include USB hard drives, etc., which if I remember correctly, one of these devices I have actually is a USB hard drive with Terabytes of data... :-)
Though If it is less than 2Tb, I guess it still would use Read10/Write10...

Ben
- https://www.fysnet.net/the_universal_serial_bus.htm
Post Reply