tech-kern archive

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

Re: kernel constructor

There are two separate issues here:

	1: link sets vs. ctors

They are exactly the same thing in slightly different clothing. Mental exercise: define link_set_ctor and run those in kernel bootstrap when you'd run __attribute__((constructor)). As David cautions, I don't think ctors should do anything apart from note that X is present in the image so that initializing X can be done later. With link sets you don't need the extra step of noting since you can just iterate when you want to.

	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?

Home | Main Index | Thread Index | Old Index