LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Device drivers : How to insmod and mknod through an application program? (https://www.linuxquestions.org/questions/linux-newbie-8/device-drivers-how-to-insmod-and-mknod-through-an-application-program-413044/)

shendeswanand 02-08-2006 11:28 AM

Device drivers : How to insmod and mknod through an application program?
 
Hi friends,
this is swanand. I have written a character device driver. I use this the functionalities of this driver only sometimes acording to the schedule.
So i wanted to install the modules inside the kernel from my application program. In the init_module, i register the device and print its major number using printk statement. Then i use mknod to create a device file.
I also tried to use system("insmod ./char.ko > fp"); to redirect the major number to a file through which i will read later, but didn't work.
Can anyone please tell me how do i install my character device driver with the system through my program ?
My problem is that how do come to know the major number which gets dynamically allocated during my init_module().
Thank you.
Warmth and regards,
Swanand Shende.


All times are GMT -5. The time now is 01:55 AM.