OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 7:43 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: USB mass-storage support in RDOS
PostPosted: Wed Dec 25, 2013 2:03 pm 
Offline
Member
Member

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


Top
 Profile  
 
 Post subject: Re: USB mass-storage support in RDOS
PostPosted: Wed Dec 25, 2013 3:45 pm 
Offline
Member
Member

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


Top
 Profile  
 
 Post subject: Re: USB mass-storage support in RDOS
PostPosted: Wed Dec 25, 2013 4:27 pm 
Offline
Member
Member

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


Top
 Profile  
 
 Post subject: Re: USB mass-storage support in RDOS
PostPosted: Wed Dec 25, 2013 11:27 pm 
Offline
Member
Member

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


Top
 Profile  
 
 Post subject: Re: USB mass-storage support in RDOS
PostPosted: Thu Dec 26, 2013 11:53 am 
Offline
Member
Member

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group