Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, I am having doubt on how to create device file for usb. and how to assign major no to it. could anybody please tell me this. thanx in advance...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2006
    Location
    Hyderabad
    Posts
    94

    how to create device file


    Hi,

    I am having doubt on how to create device file for usb.
    and how to assign major no to it.
    could anybody please tell me this.

    thanx in advance

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,275
    If you've got kernel source, you can look in the file devices.txt. This contains major nodes for all devices. You might also find the man page for MAKEDEV useful.
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  3. #3
    Just Joined!
    Join Date
    Nov 2006
    Location
    Hyderabad
    Posts
    94
    hi hazel,
    thank you for reply, but in my system iam not having kernel source code.
    i seen code for usb on www.lxr.linux.no & i successfully compiled sample code usb-skeleton.c. But i got struct at creating device file for it.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    1,275
    "I'm just a little old lady; don't try to dazzle me with jargon!"
    www.hrussman.entadsl.com

  6. #5
    Just Joined!
    Join Date
    Nov 2006
    Location
    Hyderabad
    Posts
    94
    thank u i will go through that & get back to you

  7. #6
    Just Joined! vijay_kernel's Avatar
    Join Date
    Apr 2007
    Posts
    77
    Hi,

    We create a device node by using the command "mknod".

    Instead of assigning a major number explicitly, go for dynamic allocation of the major number which assigns the free major number.

Posting Permissions

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