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.
USB mass-storage support in RDOS
Re: USB mass-storage support in RDOS
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.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.
Re: USB mass-storage support in 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.
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
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.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.
Re: USB mass-storage support in 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.