Initialisation code (Re: parport-970402 released)

Philip Blundell (phil@tazenda.demon.co.uk)
Tue, 8 Apr 1997 10:49:55 +0000 (GMT)


On Tue, 8 Apr 1997, Bas Mevissen wrote:

> In fact I still think that putting all probing/PnP/BIOS config detection
> code should be put into ONE module (init.o), and that the driver modules
> should just contain driver code.
> Windows NT does such thing: NT Detect, doesn't it?
>
> I realize that it wouldn't make much sense for memory use, but irq, io and
> dma management should become better then.

Yeah. Incidentally, it might be good to revive an idea that was kicked
around the kernel mailing list a while ago, but as far as I know never
went anywhere. It was suggested that it would be good to have some way
for the kernel to throw out code that was only used for initialisation
once the system was booted. I think you could do this fairly easily by
putting the initialisation code in a special ELF section (by using
appropriate gcc/gas magic) so that it's all contiguous, and then arranging
for init/main.c to throw out all the pages containing only text from that
section just before it starts init. Now that kernels have to be
compiled as ELF anyway this probably wouldn't be too painful to do.

That way you could add as much probing gunk as you liked, and it wouldn't
cause too much bloat on a running system. One of my machines still only
has 8MB, so saving even a few pages is fairly significant. And on ARM
machines where you sometimes have 32k pages and only 4MB of RAM, it's even
more of an issue (well, excepting the fact that we don't have ELF for the
ARM yet...)

phil