tech-kern archive

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

re: Device node creation when major number is dynamically allocated



Christos Zoulas writes:
> In article <53AC78B6.9090103%runbox.com@localhost>, Jan Sucan  
> <sucan%runbox.com@localhost> wrote:
> >Hello,
> >
> >I am interested in NetBSD kernel and I have written a simple character 
> >pseudo device driver module which calculates Fibonacii numbers. It works 
> >but there is something I am not certain of.
> >I don't know how to create device node without having to know major 
> >number allocated dynamically when the module is loaded. In earlier 
> >NetBSD versions (before module(7) framework) there was -p option to 
> >modload command specifying post-install program. One of the arguments to 
> >this program was the character device major number.
> >Now, my module prints the character device major number to system 
> >console and I use it in mknod command. Is it good approach or there is 
> >some functionality analogous to the mentioned -p option in current 
> >NetBSD versions?
> 
> I don't see anything like that. Perhaps there should be a way to query
> a module about this. For now the only thing I can think of is to use
> sysctl to register the value, and then have something query the value
> of the sysctl variable you set in the module to find the device major
> number...

you mean like the pre-existing kern.drivers node? :-)


Home | Main Index | Thread Index | Old Index