tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kernel constructor



On Thu, Nov 13, 2014 at 03:29:48PM +0900, Masao Uebayashi wrote:
> On Wed, Nov 12, 2014 at 2:53 AM, Taylor R Campbell <campbell%mumble.net@localhost> wrote:
> >    Date: Tue, 11 Nov 2014 17:42:51 +0000
> >    From: Antti Kantee <pooka%iki.fi@localhost>
> >
> >            2: init_main ordering
> >
> >    I think that "code reading" is an absolute requirement there, i.e. we
> >    should be able to know offline what will happen at runtime.  Maybe that
> >    problem is better addressed with an offline preprocessor which figures
> >    out the correct order?
> >
> > rcorder(8)...?
> 
> I'll imlement tsort in config(1), because config(1) knows module
> dependency.  Module objects will be ordered when linking, that is also
> reflected in the order of constructors.  I believe this is good enough
> for most cases.

You could look for symbol name (say) init_fn_foo, init_fn_foo_requires_xxx
and init_fn_foo_provides_yyy and use them to generate a C file of calls
to foo() in the correct order and then relink the kernel.
Or as part of the final stage of converting a netbsd.o (generated
by ld -r) into a fully fixed kernel.

	David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index