Re: System calls effect after booting phase ??

From: Valdis . Kletnieks
Date: Wed Dec 29 2004 - 07:06:55 EST


On Wed, 29 Dec 2004 03:25:10 PST, selvakumar nagendran said:

> Now, I want to store them in a table. But I want
> this operation to be started right after the initial
> booting phase itself part of the loading kernel
> itself. What should I do to add my module into the
> already compiled kernel image just like a standard
> kernel module?

Possibility 1:
Load them from an initrd image while booting. If you're already
using an initrd, and this is "early enough", you just need to put the
module into the initrd, and make sure the /linuxrc or whatever script
does an insmod for it. This has the advantage of working for out-of-tree
modules.

Possibility 2:
Build them into the kernel. For in-tree modules, this is done with
a bit of Kconfig/Makefile magic. In the Kconfig file, you can define
a CONFIG_FOO variable, and then in the Makefile, do this:

obj-$(CONFIG_FOO) += foo.o

So if CONFIG_FOO is set to 'y' (build into kernel), it gets
added to the obj-y target list and then linked in. If it's set to
'm' (module) or 'n' (don't build at all), it's added to the obj-m or obj-n
targets, which then aren't linked into the kernel.

Not sure how you'd go about building an out-of-tree module into the kernel,
or if that's even supposed to be possible...

Attachment: pgp00000.pgp
Description: PGP signature