Dhiman, Gaurav wrote:
Rubini has also given an example of script which can do this for you. The script is mentioned in the same chapter, have a look at it.
That script will automatically read the /proc/devices file, fetch the major number allocated to a device and finally create the device node with that major number in /dev.
Thanks & Regards,
Gaurav Dhiman
-----Original Message-----
From: kernelnewbies-bounce@nl.linux.org [mailto:kernelnewbies-bounce@nl.linux.org] On Behalf Of Anupam Kapoor
Sent: Wednesday, July 07, 2004 9:59 AM
To: Tomas Almeida
Cc: kernelnewbies@nl.linux.org
Subject: Re: doubt about char drivers
hi,
you can do a cat /proc/devices to get the major number for your device
and then feed that information to via a mknod to create the
appropriate device.
kind regards
anupam
On Tue, 6 Jul 2004 21:00:39 -0300 (ART), Tomas Almeida
<tomashugoribeiro@yahoo.com.br> 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~~
if we can create a regular file from within the kernel using sys_open , (get_ds, set_fs macros), we shud be able to create a device file as well.
cheers,
Amith
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/