more info about KLD
takawata at jp.freebsd.org
takawata at jp.freebsd.org
Tue Feb 17 01:05:44 PST 2004
In message <20040217033657.GG85686 at funkthat.com>, John-Mark Gurney wrote:
>> I have two questions:
>> (1) Is there any more detailed information regarding KLD in
>> addition to the KDL facility programming in DaemonNews
>> and in Architecture Book?
>
>have you checked the kernel developers handbook..
>
>> (2) Can I turn an arbitrary piece of codes in kernel into a KLD?
>> Say, the entire TCP/IP stack?
>
>Yes, for the most part you can. Though you may limited on when you
>can load/unload the code. The tcp/ip stack may be a bit difficult as
>it has interdependancies on other parts, like ipv6...
It may have some problem when the code is initialized early or
using #ifdef.
Kernel modules are loaded by loader(8) or kldload(2).
When kernel module should be initialized early, the module have to
be loaded by loader(8). The loaded module is linked in kernel boot
sequence after VM initialzied.
Another thing, #ifdef is interpreted on compiling. If there are some
code like this, the FUGAFUGA option cannot turn into module.
INET option is this example.
switch(foo){
case BAR:
hehehe();
break;
#ifdef FUGAFUGA
case BAZ:
function_in_fugafuga();
break;
#endif
default:
}
More information about the freebsd-hackers
mailing list