> > 3. Is it possible to automatically create a device file in /dev from a
> >    module?
> 
> Not really, at least not from a loaded kernel module.

sure you can.  ipfilter was doing this back with LKMs in the 90s :-)

> BTW, devsw_attach() doesn't "automatically generate the major".  It does 
> a lookup in the majors table.  If there is no entry in the table, you 
> get an error.

see eg this line in devsw_attach():

                newptr = kmem_zalloc(new * DEVSWCONV_SIZE, KM_NOSLEEP);

for what happens when the entry isn't found.


.mrg.

Reply via email to