How/When does the kernel know to load a module?

chenliang@163.net ("chenliang@163.net")
Sat, 24 Apr 1999 09:05:10 +0800


Hi,everybody,

I'm reading the kernel source code now, but it's some what abstruse to
me.

Some people said that the kernel is smart enough to automatically load a
module. However, I could find nowhere of the kernel code deals with
this.
My first question is by what means the bare kernel knows that it needs a
function residing in a module?

For example: I traced the souce code of the network. As the bare kernel
setting up, it calls 'net_dev_init()'. 'net_dev_init()' will follow the
link: 'dev_base' to autoprobe net devices. I have a NE2000 card. I think
the kernel would call 'ne_probe()',( the function is in the module ne.o
), but it didn't. The ne.o module is loaded only when the 'rc.d' shell
runs 'ifconfig eth0...'. My second question is why the kernel didn't
call 'ne_probe()' at first? and is it the 'ifconfig' informs the kernel
to load a module? and by what means to inform?

Thanks for your help.
Chen l.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/