lkml.org 
[lkml]   [2005]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: proc_mknod() replacement
    Hi,

    Thanks for reply.

    On 5/9/05, Erik Mouw <erik@harddisk-recovery.com> wrote:
    > On Mon, May 09, 2005 at 07:17:44PM +0800, KC wrote:
    > > I found that proc_mknod() had been removed from kernel 2.6.x.
    > > Any replacement ?
    > >
    > > Or how can I create file, device node or dir from device driver ?
    >
    > You don't do that from a device driver in the first place. Have a look
    > at udev, it will do what you want from userspace.

    For regular file, I do agree with you. But for device node, I don't see
    anything wrong by create it directly from kernel space.
    In fact, I do not understand why proc_mknod() is removed from
    2.6.x ... I will be happy if someone can tell me why.

    Why I want to use proc_mknod() in driver ? I write a small package, ovi-dev,
    which can be downloaded from
    http://www.sourceforge.net/projects/ovi
    The ovi-dev will scan the PCI bus and if it found, eg, 3 PCI devices, it
    will create 3 device entries (nodes) automatically at module load time.
    So number of device entries (nodes) will match number of devices
    of the system ... well, UNIX/Linux doesn't work that way ... there are a lot
    of device entries ... but no corresponding hardware existed.

    The proc_mknod() can fix the problems ... but it was removed from 2.6.x ...
    too bad ... at least for me. So I'm looking for an alternative way to create
    device entry under /dev from drivers instead of /proc ... but still don't know
    how. Anyone know how to do that ? It should be done at module_init()
    and the entry should be removed at module_exit().


    Thanks
    KC








    >
    > Erik
    >
    > --
    > +-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
    > | Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
    >
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-05-09 19:09    [W:3.665 / U:0.688 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site