Re: doubt about char drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tomas Almeida wrote:

Hello everybody

I'm reading the "Linux Device Drivers" (Alessandro
Rubini), and i'm in chapter that we learn to build a
char driver. I'm necesarilly at the point where he
argues about dynamical allocation of major numbers but
i have one doubt (for the moment), if i use the
dynamical allocation, its because i dont have a one
major number exclusive of my char driver and then..
who will make the device nodes to my char driver?! I
have to guide my driver to print the major number that
it found dynamically and then make the nodes manually?


Forgive eventual english mistakes..


Atenciosamente, thr~~



Tomas,
Your english is fine. :) When registering your driver if you pass 0 as the argument of the major number, then the driver will be assigned a dynamic major number. You can then write a script to make the device nodes for the given dynamic major number. An example script for making device nodes can be seen here: http://www.xml.com/ldd/chapter/book/ch03.html#t2
under "Dynamic Allocation of Major Numbers".


-Bill


-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux