Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Operating Systems Software Linux

User Space Driver for USB Storage Devices? 59

Zarf asks: "With Linux, if you don't like something, fix it yourself. So when I couldn't get my USB pen-drive to work and none of the canned solutions were satifactory... I took it upon myself to fix Linux. I've posted my solution in my Slashdot user's journal. But it seems to me that there must be a better way to promote my solution. Where should I post my fix so it can help the most people?"
This discussion has been archived. No new comments can be posted.

User Space Driver for USB Storage Devices?

Comments Filter:
  • by KDan ( 90353 ) on Thursday September 18, 2003 @06:43AM (#6992873) Homepage
    Posting it on slashdot. I hear lots of people read that site.

    Daniel
  • The Manufacturer (Score:5, Insightful)

    by rmohr02 ( 208447 ) <mohr.42NO@SPAMosu.edu> on Thursday September 18, 2003 @06:45AM (#6992880)
    Contact the manufacturer of the pendrive--ask them to place it on their website. If someone had the same problem you had, they would go to the manufacturer. They might even put your code on one of those mini-cds that the put the Windows 98 USB drivers on.
    • DO NOT DO THIS (Score:4, Interesting)

      by Anonymous Coward on Thursday September 18, 2003 @07:04AM (#6992924)
      Please do not do this. It gives the impression that OSS programmers are free labor for hardware companies. Put it on a page on SourceForge or host it on your own site. Make sure, whatever you do, that you do it on your own terms. Do not make everyone else's work worthless by giving it away for free with no reciprocity.

      If you needed it and you want to share it with others, that's awesome. But don't let someone else get away with making a buck off of it without putting an ounce of effort into helping you.

      If you do approach the company, make it clear that you are willing to sell them a license to distribute it.
      • Re:DO NOT DO THIS (Score:5, Insightful)

        by passthecrackpipe ( 598773 ) * <passthecrackpipe@@@hotmail...com> on Thursday September 18, 2003 @09:53AM (#6994004)
        On the contrary, it may signal to hardware developers that OSS developers are a clever buch that are willing to help out to make *their* hardware work. They may become more lenient in publishing hardware specs under reasonable disclosure terms, and who knows, we could get better drivers.....
        • Not that I disagree or anything, I just thought it was funny. I think that you both have good points. Maybe he could contact the company and give the software to them on the condition that they agree to release any needed information (now and in future products) for the development of better drivers?

          Just a thought-

          Benjamin
      • If you do approach the company, make it clear that you are willing to sell them a license to distribute it.

        Unless you place your code under any Free or Open Source license. Then you ALREADY have given them a license to distribute it.
        • Re:DO NOT DO THIS (Score:3, Interesting)

          by rmohr02 ( 208447 )
          You can still sell them the rights to use it under an alternative license so that they don't have to worry about the restrictions of the GPL when distributing the program to customers.
    • The driver is for all pen-drives. It's a "user space driver" not a binary driver. All it does is create fstab entries and clean up mountpoints for you.
  • SourceForge (Score:3, Informative)

    by Baines ( 13567 ) on Thursday September 18, 2003 @06:46AM (#6992881) Homepage
    http://sourceforge.net/
  • Any thoughts to port it to C and releasing it as a closed source driver? Might make a couple bucks...

    If you were unhappy with the driver, it's more than likely some Japanese embedded engineer is sitting in his cube wishing that he could get his hands on a working USB pen storage driver that he didn't have to worry about releasing the source to.
    • Any thoughts to port it to C and releasing it as a closed source driver? Might make a couple bucks...


      Your promoting recoding into C, making it closed source and then SELLING it for profit?

      What kind of geek are you?
    • Why port it to C if you're just going to make it closed source?

      [dave@tc11 bloat-dev]$ perlcc -o bloat.o bloat
      [dave@tc11 bloat-dev]$ file bloat.o bloat
      bloat.o: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically linked (uses shared libs), not stripped
      bloat: perl script text executable

      Hey, you could even use perlcc -c (outputs C code) with the same usage options, make it open source, and still have the benefits of it being closed ;-) (if you don't get this joke, you've not seen C output by perlcc

  • Sir (Score:5, Funny)

    by gazbo ( 517111 ) on Thursday September 18, 2003 @06:50AM (#6992890)
    Slashdot is the wrong place not only for the driver, but also for you. You had a need, and used the open source philosophy to scratch your itch, and then released the code; Slashdot is designed for people who don't actually have coding skills, but instead like to talk about how great open source is because if they could code and if they ever actually needed to, then they could modify software.

    Oh, and for people who waste their lives gaming too.

  • Hotplug (Score:5, Informative)

    by warmcat ( 3545 ) * on Thursday September 18, 2003 @06:57AM (#6992906)
    Maybe you should contact hotplug [sourceforge.net], so they can consider to either include it in the docs or the package, since it just seems to be a perl hotplug script.
    • I give you the gold medal. You actually tried to answer my question. Kudos to you!

      The problem is that this is a "Redhat 9" problem. If you look at the Red Hat 9 standard "/etc/hotplug/usb" directory you'll find one script in there. It's the "usbcam" script written by... A programmer at Redhat. So I assume that the "correct" place for "/etc/hotplug/usb" scripts to come from are from distro people.

      I will contact the hotplug people but I have a feeling that they will respond that this isn't "part of" hot
  • Ehh... (Score:5, Informative)

    by LinuxGeek8 ( 184023 ) on Thursday September 18, 2003 @07:54AM (#6993089) Homepage
    Sorry, but I don't get it. What you're doing is adding the device id's to the usb.usermap. If that's all that's needed, you culd just add it to the driver itself, or wherever it is normally put.

    For the script, all it does is load the right modules and mount the device, right?
    Loading the modules is what hotplug does, and mounting automatically with sync can be done with supermount.

    I'm no usbguru, programmer or bashguru, so maybe I'm missing something...
    I'd just contact the people from the usb-storage driver, and the hotplug people, if I had issues with it, and it's not clear to me what your isssue exatly was, and what you really needed to do to fix your issue.
    • Re:Ehh... (Score:5, Insightful)

      by LinuxGeek8 ( 184023 ) on Thursday September 18, 2003 @07:58AM (#6993104) Homepage
      Btw, what's up with the title "User Space Driver for USB Storage Devices"?
      You're still loading the kernel drivers to talk to the device, and mount that. If you mean the automount script, that's not really a driver.

      If you really need user space you could look at libusb, all that libusb needs is a driver loaded for the host controller, and for the rest it should be able to talk to the device from userspace. But if it can do usb-storage, I have no clue about that.
      • I think you've completely missed the point. The point is that to the uninitiated user, they plug the drive in and nothing happens. The GUI doesn't automatically respond to the presence of the new drive and so ... it doesn't "automagically" work. This proves that users are indeed stupid. For if they were smart they would merely read /var/log/message themselves and know which scsi emulated device was added and then mount it themselves either with su, sudo, or by hand editing their fstab.

        My solution is not
        • I don't know how RedHat deals with this thing, but you could file a bugreport on their bugzilla I guess.
          In Mandrake, the modules should be loaded by hotplug, and then dynamic should make an icon on your Gnome or Kde desktop, which you can use to mount it. Ofcourse, hotplug and the usb drivers should know which driver belongs to the hardware, when looking at the device id's, so essentially that should be all that's needed to do.
          If it doesn't work like that, something is broken somewhere.
        • I am using RH 8.0 and a NextCom pen drive called Sundrive. Any ideas for getting your perl script to work there? I saw your note that you have to insert the pen drive twice after reboot under RH 9. That didn't make a difference here. In /var/log/messages: usb.agent: module setup usbstorage for USB product d7d/150/100 But no /etc/fstab entry or mounting is happening automagically. I am currently using the see-which-device-to-mount-in-messages-and-mount-i t philosophy but will be delivering a system to
          • Okee dokee...

            Did you try the script in my journal at all? You should look at the "hotplug" stuff online... if you don't want to just trust me... You'll need to edit the file /etc/hotplug/usb.usermap and add the line: "usbstorage 0x0030 0x0000 0x0000 0x0000 0x0000 0x00 0x00 0x00 0x08 0x00 0x00 0x00000000" ... the 0x08 matches on the usbstorage device... you can map this on to a specific device or whatever.

            Next you'll want to copy the script from here:

            http://slashdot.org/~Zarf/journal/44708

            into th
  • The approrite place would be on the LKML...
    In One of two ways....
    1. Post the patch to the list explaining what its for and what it does...
    2. Post to the list asking who the maintainer of the USB realm for that device is, send the patch to them...

    or
    3. Check the Kernel Maintainers file for same information as #2
  • by _iris ( 92554 )
    LKML, Duh.
    • LKML for a Perl userspace driver? I don't think so...

      OTOH, the idea of rewriting the Linux kernel in Perl is certainly nice *g*

  • You appear to have independently invented hotplug, or usb-mgr. Cool, though.
  • Any Success Stories? (Score:2, Interesting)

    by Schlaegel ( 28073 )
    Does anyone have a success story for these sticks working out of the box on a linux distro.

    I have become embarrassed when my Windows using friends want me to copy something onto their usb stick.

    I am running Red Hat 9, and can not get the sticks to work. I can dual boot to Windows on the same hardware and they just work.
    • you'll have to load all the needed modules.

      /sbin/modprobe sr_mod

      /sbin/modprobe sd_mod

      /sbin/modprobe usbcore

      /sbin/modprobe uhci

      /sbin/modprobe usb-storage

      /sbin/modprobe vfat

    • I think this whole topic is hilarious. Why? Because all the Linux fanboys keep telling me that FreeBSD is antiquated, dying, and doesn't support any hardware. But I can stick any USB Mass Storage device on my system and it just works. Out Of The Box(tm). This includes every thumb drive I've tried, my Olympus digital camera, and that cheesy Iomega USB CDRW at work (it won't burn to CD though).

      Of course, FreeBSD by default has a bare bones configuration, so I do a trivial amount of work to allow user mountin
      • Frankly, I can't understand why Linux has problems with USB Mass Storage.

        Umm. It doesn't.

        Did you even read those journal entries (oh, yes, this is slashdot. Of course you didn't.), this is not really a driver and he didn't have any trouble getting that USB Mass Storage to work Out Of The Box(tm), he just didn't like having to mount it manually and wrote a hotplug script that does that. No big deal.

    • I have a success story, on RH8. I have a TwinMOS "Mobile Disk", plugged it in to my box, and it was automatically detected. I had to mount it manually (" mount /dev/sdb1 /mnt/disk "), and it worked perfectly. (Ok, it did take me 10 minutes to realise that I should mount sdb1, not sdb - I blame lack of sleep).

      Seems weird that it would work less easily under RH9.

      David.
    • Actually, yes. I have a USB stick that works out of the box on SuSE 8.2. The REALLY neat thing is that I got the stick from MS (it even has the Micro$oft logo on it) as a "thank you" for attending one of their free seminars.

    • Plug that usb stick in, wait 3 secs, mount /dev/usbX /mnt/usb-disk and you're set. Do all file transfer work, then umount /mnt/usb-disk and remove that thing.

      I used a properly patched Redhat 9 and it worked extremely easy. I used a no-name generic usb-stick with the lowest price tag I could find.

      The only quirk was a "device busy"-bug that occured sometimes so the filesystem could not be cleanly unmounted. This was because some subsystems of Nautilus or any other filemananger component did not release the
      • The only quirk was a "device busy"-bug that occured sometimes so the filesystem could not be cleanly unmounted. This was because some subsystems of Nautilus or any other filemananger component did not release the filesystem lock properly when closing its windows and the force-unmount had no effect.

        My "driver" fixes this problem... to a certain extent. The boss didn't like having to drop to the command line to mount and unmount the device. So I was commissioned to write this script. The other problems I
    • Has anyone tried using Mandrake? I have a USB-to-IDE
      external kit that I use to add a second hard drive to my laptop.
      Under Mandrake 9.1, I pop the 20gig drive into the case, connect both ends of the cable and the drive gets automounted. Couldn't be simpler.
    • Red Hat 9, actually does work out of the box. It's just that to find what drive you should issue a "mount" command on you need to look in /var/log/messages, or at your scsi bus to figure out not only that a usb device has been hooked to the system but that it is running as ... most commonly ... sda1. Remember you aren't guaranteed sda1, if you have two pen drives one will be sda1 and another will be sdb1 ... or something.

      You can add a line in fstab, or you can use my script to do it for you... yes, I kno
  • USBMan.com (Score:3, Interesting)

    by Stavr0 ( 35032 ) on Friday September 19, 2003 @10:32AM (#7003663) Homepage Journal
    A nice resource for all that is USB. I found some UBS drivers for DOS that allows mounting Pendrives off a strait msdos boot floppy -- something that was supposed to be impossible.

    USBman's Linux section [usbman.com]

  • I would like to thank you all for your comments. I have found the majority of your posts entertaining. If I had enough moderator points I'd give most of you a pat on the back. I would like to thank those of you who actually tried to answer my question and I'll be off now to try and implement some of these.

    Those of you who actually read the discussion threads in my Journal might see how even amongst the intelligent and clueful people who post in my Journals that there is confusion on the "proper" way to h

Get hold of portable property. -- Charles Dickens, "Great Expectations"

Working...