Re: More linker magic..

Brian Gerst (bgerst@quark.vpplus.com)
Tue, 03 Aug 1999 15:01:03 -0400


Linus Torvalds wrote:
>
> Ok, I finally did what I've wanted to do for a _loong_ time: get rid of
> the horrible #ifdef CONFIG_XXXX mess in init/main.c.

drivers/net/Space.c also has a setup like this which should also be
junked.

> Instead, any driver, filesystem or other entity can just register a kernel
> command line string and/or a initialization function that will be executed
> by using a magic section in the kernel linkage. So there is no need to
> touch a common file to add a new driver or a architecture-specific kernel
> command line entry.
>
> I've fixed up a few of the old command lines and initialization functions,
> but I'm hoping that driver writers can re-instate their own setup
> functions rather than me trying to fix up them all by hand. For that
> reason there is now a pre-patch-2.3.13-3 on ftp.kernel.org under
> "testing".

I think a better approach for drivers or any other part which is
currently able to be compiled as a module would be to modify the module
interface to also work when compiled into the kernel, using similar
linking tricks. This way there would be one object that can be
insmod'ed or directly linked into the kernel with the linker doing all
the magic. This would remove the dependency on CONFIG_MODULE for many
files. Also the parameter passing would be consistent between the boot
command line and insmod.

--

Brian Gerst

- 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/