Re: Major number changes after each insmod
- From: Bill Waddington <william.waddington@xxxxxxxxxx>
- Date: Wed, 01 Dec 2010 10:55:53 -0800
On Wed, 01 Dec 2010 11:12:44 +0100, Guillaume Dargaud
<use_the_contact_form@xxxxxxxxxxxxxxxx> wrote:
Hello all,
I'm working on my first 'real' driver for linux (I've done libusb and other
usermode drivers before) and I have some basic questions.
First in the init of the module, I do:
rc = alloc_chrdev_region(&dev,minor,nr_devs,"MyDev");
major=MAJOR(dev);
But the value of dev changes each time I do a new rmmod/insmod: 254, 253,
etc...
So how can match it with mknod ?
mknod /dev/MyDev c 254 0
Right now I need to do it manually each time.
Can't I fix the major number in my driver initialization ?
My load scripts get the major number from /proc/devices. This is left
over from the pre-udev days. I don't know what the official approach
is these days.
http://www.tahomatech.com/downloads/drivers/linux_2.6/pci/x86/files/hardcopy/ihcp_install-2.6
Search for "if [ $1 = load ]" These scripts are pretty clunky -
should make them easier to read :)
Bill
--
William D Waddington
william.waddington@xxxxxxxxxx
"Even bugs...are unexpected signposts on
the long road of creativity..." - Ken Burtch
.
- Follow-Ups:
- Re: Major number changes after each insmod
- From: Lawrence D'Oliveiro
- Re: Major number changes after each insmod
- References:
- Major number changes after each insmod
- From: Guillaume Dargaud
- Major number changes after each insmod
- Prev by Date: Re: Major number changes after each insmod
- Next by Date: Re: Major number changes after each insmod
- Previous by thread: Re: Major number changes after each insmod
- Next by thread: Re: Major number changes after each insmod
- Index(es):
Relevant Pages
|