Re: procfs problems

Keith Owens (
Thu, 01 May 1997 19:18:34 +1000

On Wed, 30 Apr 1997 13:56:40 -0700,
Perry Wagle <> wrote:
>Well gee, now I have my very own major device number, how does the
>user process open it? I have to first tell them what the major device
>number is, and they (apparently) have to mknod a bunch of char-special
>files to open and ioctl to. Okay, kinda clunky, but it works.
>How do I tell him that the major device number is? Why, I use a
>procfs file to give it to him. This last bit (getting the major
>device number to the user process), seems to be consistantly left out
>of discussion here. Am I unaware of something?

Take a look at the pcmcia code. It registers a dynamic character
device which *automatically* adds the name and device number to
/proc/devices. The pcmcia user level code does insmod then reads the
kernel assigned device number, deletes any existing pcmcia devices then
creates new ones. This is *required* for dynamic device type
registration and is much better handled by the user level code.