USB mass-storage support in RDOS

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
rdos
Member
Member
Posts: 3286
Joined: Wed Oct 01, 2008 1:55 pm

USB mass-storage support in RDOS

Post 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.
PearOs
Member
Member
Posts: 194
Joined: Mon Apr 08, 2013 3:03 pm
Location: Usually at my keyboard!

Re: USB mass-storage support in RDOS

Post 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.
rdos
Member
Member
Posts: 3286
Joined: Wed Oct 01, 2008 1:55 pm

Re: USB mass-storage support in RDOS

Post 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.
PearOs
Member
Member
Posts: 194
Joined: Mon Apr 08, 2013 3:03 pm
Location: Usually at my keyboard!

Re: USB mass-storage support in RDOS

Post 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. :|
rdos
Member
Member
Posts: 3286
Joined: Wed Oct 01, 2008 1:55 pm

Re: USB mass-storage support in RDOS

Post 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.
Post Reply