I've never understood how you manage kernel modules at boot time

Robert P. J. Day rpjday-L09J2beyid0N/H6P543EQg at public.gmane.org
Mon Feb 25 19:54:22 UTC 2008


On Mon, 25 Feb 2008, Mike Oliver wrote:

> Quoting "Robert P. J. Day" <rpjday-L09J2beyid0N/H6P543EQg at public.gmane.org>:
>
> > well, it's the job of kernel code to "register" for a major device
> > number and possibly multiple minor numbers with a call to, say,
> > "register_chrdev".  if that call succeeds, then a record of that is
> > made in /proc/devices:
> >
> > $ cat /proc/devices
> > Character devices:
> >  1 mem
> >  4 /dev/vc/0
> >  4 tty
> >  4 ttyS
> >  5 /dev/tty
> >  5 /dev/console
> >  5 /dev/ptmx
> >  7 vcs
> > 10 misc
> > 13 input
> > 14 sound
> > 21 sg
> > 29 fb
> > 81 video4linux
> > ...
> >
> >  in addition, in the old days, once that succeeded, it was still
> > *your* job to use "mknod" to create a device file with the appropriate
> > attributes.
> >
> >  these days, that's normally done automatically via "udev" and the
> > udev rules.  but in terms of where the whole process starts, it's the
> > kernel code that gets things rolling by attempting to allocate a major
> > device number as above.
>
> OK, getting somewhere, I think.  So how do I set things up so that
> the kernel registers a new device at boot time,
> that it isn't currently registering?

see my newest post -- it's various kernel drivers that try to grab a
major character device number with "register_chrdev" -- everything
follows from that.  having a special device file does you no good
unless there's underlying kernel code that's allocated that major
number.  in your case, the nvidia driver, when it's loaded, *must* try
to allocate a major number that's going to correspond to the eventual
special device file.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list