Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Hi all, does anybody know how to develop a USB Device Driver in User Space. I have already read many articles from Linux Journal. But what I want is a ...
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    11

    USB Device Driver Development

    Hi all,
    does anybody know how to develop a USB Device Driver in User Space. I have already read many articles from Linux Journal.
    But what I want is a way to develop a USB Device Driver that resides partially in Kernel Space and partially in User Space. And then an application accesses this User Space Driver and then carries out some operations.

    Any kind of suggestions are invited. Please do help me.

    Regards
    Ameya Verma
    Last edited by ameya.verma; 05-21-2008 at 05:44 AM. Reason: ddd

  2. #2
    Linux Newbie
    Join Date
    Mar 2008
    Location
    Hyderabad
    Posts
    109
    I am not excatly getting you. But you can implement
    ioctl function in the usb driver and give commands from user space programs.

  3. #3
    Just Joined!
    Join Date
    Apr 2008
    Posts
    11
    hi Digvijay,
    what i wanted to say was basically a User Space Device Driver has two part....One part resides with the kernel itself which is responsible for registering the Device and the Driver with the Kernel (Entry in devfs /dev/)....and a second part which is in User Space which interacts with the Device Entry in the devfs.....and then there is an application which interacts with this User Space part and carry out some Operations.....plz suggest whether what I am thinking is right or not and plz suggest a war around......

  4. #4
    Linux Newbie
    Join Date
    Mar 2008
    Location
    Hyderabad
    Posts
    109
    You go through last section of:-
    http://lwn.net/images/pdf/LDD3/ch02.pdf

    The user space driver also rely on some generic functionality which is provided by kernel drivers.
    But some drivers are there which are completely user space based.
    The USB scanner driver is on examaple of this.

  5. #5
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Lightbulb

    OT,but related to USB - Do you know what's the file system used in USB
    Is ext2/3 used there? or something else
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  6. #6
    Just Joined!
    Join Date
    Apr 2008
    Posts
    11
    hi Digvijay,
    thanx for the reply....so can there be a way of writing a USB Driver that comply to the requirements I have given above (One part residing in the Kernel and the second part residing in the User Space).....plz do reply

    Regards
    Ameya Verma

  7. #7
    Linux Newbie
    Join Date
    Mar 2008
    Location
    Hyderabad
    Posts
    109
    I am sure this link will help you a lot.
    http://lwn.net/images/pdf/LDD3/ch13.pdf
    You can write USB driver that way. But you need to be aware of Specification of the USB device you are going to program

  8. #8
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    I would look into the FUSE stuff. It has a kernel part, but the actual FUSE base stuff (ntfs3g, sshfs, etc) are implemented in userland. It might serve you as an example or even as a base.


    Quote Originally Posted by Lakshmipathi View Post
    OT,but related to USB - Do you know what's the file system used in USB
    Is ext2/3 used there? or something else
    You can format an usb drive on whatever format you like, just like any other block device (or even file). The only problem is that USB devices are meant to be portable amongst as many oses as possible. That's why most people format them using FAT or NTFS. But you can use any other fs if you think it's better for you.

  9. #9
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Question

    Quote Originally Posted by i92guboj View Post
    That's why most people format them using FAT or NTFS. But you can use any other fs if you think it's better for you.
    Thanks i92guboj .
    Do you know, why file transfer from USB to HDD is much more faster?
    Is that anything do with USB fs or related to some USB hardware issue?
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  10. #10
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by Lakshmipathi View Post
    Thanks i92guboj .
    Do you know, why file transfer from USB to HDD is much more faster?
    I don't understand the question. Faster than __________?

    In principle, USB is not the fastest thing. If you mean that it's faster than to transfer from one hard disk to another, then that amazes me, unless your hard drives are not using DMA which would surprise me nowadays because most distros can handle that out of the box.

    If you copy files within the same hard disk, then it might be a filesystem or IDE/SATA controller issue. Or maybe your hard drive is ancient.

    Generally, transferring data between two drives is faster than copying it from one location to another within the same drive, that's because the I/O is distributed and while one device reads the other is free to write. But it all depends on the concrete device and many other factors, generalizations are never correct 100%.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...