Subject: Re: foo_init()s in main() [was: CVS commit: src/sys]
To: None <>
From: None <>
List: tech-kern
Date: 11/22/2005 10:29:17
On Tue, Nov 22, 2005 at 09:34:20AM +0100, Martin Husemann wrote:
> On Tue, Nov 22, 2005 at 11:29:35AM +1100, Simon Burge wrote:
> > It really seems like we should do something to automate this, say based
> > on the FreeBSD sysinit stuff or linksets or something.
> Yes, we should.
> Could anyone give a summary of "FreeBSD sysinit" stuff?

The FreeBSD sysinit mechanism let the ELF (binutils) linker build a
large table of all sysinits, sorts them in the kernel and processes them
in a well-defined order. It is also used for other things, like the
newbus framework to hook in the driver modules.

The only question for NetBSD adoption is, whether any architecture still
has a non-ELF kernel. I don't mean the format of the final image, but
whether the linkage is ELF. Depending on that, the work can be just used
or needs some work in ld for the specific format.