Re: Calling do_mknod() from init_module()

Keith Owens (kaos@ocs.com.au)
Fri, 04 Apr 1997 10:51:12 +1000


On Thu, 3 Apr 1997 05:19:01 -0600 (CST),
rick@dgii.com (Rick Richardson) wrote:
>But this then brings up the issue: what good are dynamically
>allocated major numbers, then? If you don't know what the
>major number is going to be you can't make the device nodes
>when the driver is installed.

Take a look at the pcmcia code. When the module is insmod'ed it grabs
a dynamic major number. This is automatically logged in /proc/devices
and the *user* level code reads that to get the current pcmcia major
number. kernel gets the major number and publishes it, the rest of the
work, including node creation, is done at user level.