Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, one can use "mknod" to create an new device in the /dev directory in linux. But this is through the console. If I like to create a device, giving ...
  1. #1
    Linux Newbie rinjo's Avatar
    Join Date
    Feb 2007
    Location
    Bangalore, India
    Posts
    224

    Question equivalent of mknod

    Hi,

    one can use "mknod" to create an new device in the /dev directory in linux.
    But this is through the console. If I like to create a device, giving the major and minor number, in my code, is there any kernel call for the same???

    Any kind of help will be appreciated.
    Linux Rocks!!!!

    Rinjo

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Sure. It's called, um, mknod.

    For more information, do this at the shell prompt:
    Code:
    man 2 mknod
    If man pages are not installed on your system, google this:
    Code:
    man mknod linux
    and focus on the results that say mknod(2), not mknod(1).

    And in case you had already tried this shell command on your system:
    Code:
    man mknod
    and had been disappointed to see only the keyboard command, it turns out that the man command only shows you (in general) the lowest-numbered page. If you want all of them, you can do this at the command line, for example:
    Code:
    man -a mknod
    and it will show you all of them, one at a time.

    Hope this helps.
    --
    Bill

    Old age and treachery will overcome youth and skill.

  3. #3
    Linux Engineer
    Join Date
    Nov 2004
    Location
    Ft. Polk, LA
    Posts
    796
    If you are more interested, check out the mknod source. It is found in coreutils.

  4. #4
    Linux Newbie rinjo's Avatar
    Join Date
    Feb 2007
    Location
    Bangalore, India
    Posts
    224
    Thanks guys!
    I have already found the solution and implemented it, before i read your posts. But your inputs are highly appreciated.
    Linux Rocks!!!!

    Rinjo

  5. #5
    Just Joined!
    Join Date
    Apr 2009
    Posts
    5
    Hey Rinjo,

    May I know How did you implement it?

    Because I am also in verge of implementing through kernel source code?

    Thanks,
    Saurabh Chokshi

Posting Permissions

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