Dynamic Allocation of Major Numbers
I have a question in driver when ever we do
Code:
register_chrdev (major, “name”,*fops) your module can’t be guaranteed to always be the same. How can we retrieve major number from /proc/devices/ before doing mknod .i.e . I dont want to see mknod everytime ,how it can be done dynamically. I think some script file is required to write . |
Quote:
If you don't want to use udev, write an init script that retrieves the major and minor number of your device node by reading the /sys/devices/.../yourdevice/dev file (which I believe is provided by the device subsystem core; available immediately after the register_chrdev() call has completed), then creates or recreates the device node in /dev. |
All times are GMT -5. The time now is 05:55 AM. |