Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, I have video capture PCI card and also driver. This driver does ths dynamic allocation of major number to identify the driver module. Is it possible to change the ...
  1. #1
    Just Joined!
    Join Date
    Apr 2007
    Posts
    32

    Change major number

    Hi,

    I have video capture PCI card and also driver. This driver does ths dynamic allocation of major number to identify the driver module.

    Is it possible to change the dynamically allocated major number. If so , how can it be done.

    Your any suggestion will be greatly appreciated.

    Thank you

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    You can change this in the function register_chrdev in the source code of your driver.
    The function is defined as follow:
    Code:
    int register_chrdev(unsigned int major, const char *name, struct file_operations *fops);
    If the value of major = 0 the kernel will assign a dynamic major number otherwise the kernel will assign the given number.
    First look through the used numbers in /usr/src/linux/Documentation/devices.txt.

    Regards

  3. #3
    Just Joined!
    Join Date
    Apr 2007
    Posts
    32

    Change Major number

    Hi

    Thank you. I know this.

    But my driver is developed on the library module saa7146_vv (i.e Video4linux API) Here this library will take care of assigning the standartd major number 81 , whenever I do /sbin/insmod driver_module.ko .


    Now can body suggest me How can I change the major number.

    Note: I would like to change the major number after inserting the module in the kernel

    Any suggestions

    Thank you.

  4. #4
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    Well, there's is a way to to do a kernel patch without a LKM; if you have some knowledge of the kernel and LKM's, you may give it a try:

    http://doc.bughunter.net/rootkit-bac...-patching.html

    Regards

  5. #5
    Just Joined!
    Join Date
    Apr 2007
    Posts
    32

    re

    Hi
    Thank you.


    It helps me a lot.

    Best Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...