Page 1 of 1
USB mass-storage support in RDOS
Posted: Wed Dec 25, 2013 2:03 pm
by rdos
Partly thanks to the code in tatOS I now have a USB mass-storage driver in RDOS. There seems to be some performance problems, and the disc-change code doesn't always work, but at least it works (even over hubs) when used in a controlled way.
I'm not sure why it takes 10 seconds to write 3MB to the disc, but I suspect it has to do with writing single sectors at a time.
Re: USB mass-storage support in RDOS
Posted: Wed Dec 25, 2013 3:45 pm
by PearOs
rdos wrote:Partly thanks to the code in tatOS I now have a USB mass-storage driver in RDOS. There seems to be some performance problems, and the disc-change code doesn't always work, but at least it works (even over hubs) when used in a controlled way.
I'm not sure why it takes 10 seconds to write 3MB to the disc, but I suspect it has to do with writing single sectors at a time.
Writing single sectors at a time does cause a performance issue if I remember correctly, I tested tatOS, I found it took a while to detect a Mouse device, so I wonder if there are some issues with speed when working with USB Devices.
Re: USB mass-storage support in RDOS
Posted: Wed Dec 25, 2013 4:27 pm
by rdos
I only used tatOS as a reference for how to handle the SCSI protocol. I also found a SCSI-specification (first time) so I could check what the commands was supposed to do.
My implementation doesn't use the EHCI/OHCI controller directly, rather uses a generic USB API that works both directly with USB-controllers, and via hubs.
I'll primarily use it to format USB discs, so performance doesn't mean a lot.
Re: USB mass-storage support in RDOS
Posted: Wed Dec 25, 2013 11:27 pm
by PearOs
rdos wrote:I only used tatOS as a reference for how to handle the SCSI protocol. I also found a SCSI-specification (first time) so I could check what the commands was supposed to do.
My implementation doesn't use the EHCI/OHCI controller directly, rather uses a generic USB API that works both directly with USB-controllers, and via hubs.
I'll primarily use it to format USB discs, so performance doesn't mean a lot.
Oh I see, nice implementation. I am trying to get EHCI support myself working though I've ran into a issue when I live booted.
Re: USB mass-storage support in RDOS
Posted: Thu Dec 26, 2013 11:53 am
by rdos
The performance issue was easy enough to solve. There is no need to bother about scatter-gather and try to collect as much as possible in the same TD. It works perfectly well to just queue-up one TD per sector, and tell the disc that it should read/write multiple sectors. With this in place, it works very fast (3MB transfers in less than a second, which is comparable to my Windows machine). I typically use 64k blocks (128 sectors) for large enough files that are on consequitive sectors.