On Mon, 4 May 2015, Kamil Rytarowski wrote:
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.
On the other hand, modules are also applicable to rump environments,
and you _can_ dynamically create the /dev
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
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
matthew green writes:
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,
Sent: Monday, May 04, 2015 at 11:39 AM
From: Paul Goyette p...@vps1.whooppee.com
To: Kamil Rytarowski n...@gmx.com
Cc: tech-kern@netbsd.org
Subject: Re: Dynamic modules
On Mon, 4 May 2015, Kamil Rytarowski wrote:
3. Is it possible to automatically create a device file in /dev from