Re: Driver & kernel initialisation

Jacques Gelinas (jack@solucorp.qc.ca)
Fri, 13 Dec 1996 11:02:30 -0500 (EST)


On Fri, 13 Dec 1996, Bas Mevissen wrote:

> What about merging a database file with the kernel image (or always using an
> initial ramdisk) with the followin info:
>
> 1) Kernel initialising parameters (like the command line options)
> 2) Module(s) initialising parameters and options to kerneld
> (like /etc/conf.modules) (Is it possible to make kerneld a kernel
> deamon?)
> 3) Options for PNP support. (Yes, it will come to the kernel in future)
>
> Then all 'difficult' parameters are managed centrally. The main advantage of
> this is that you can make a kernel with all disk and fs support as a module:
> you insmod the appropiat modules at boot time.
>
> This needs some polishing, but I hope this is a good start....
> For example to build a simple file system support for the initrd that is
> always available.

I am about to introduce a mecanism in the modules allowing developpers to
define with some special macros the parameters accepted by their module
and also some information allowing classification of the modules (ethernet
adaptor, ...). These macros will encode strings into a special ELF
segment. This segment won't be load, but will easily parsed by the module
utilities to give you an idea of what is available (configuration
options).

This could be very well apply to the kernel in general. The nice thing is
that what gets linked will influence the list of boot option for a given
kernel. This has no runtime overhead and simplify life for programmers.
Given that this formal documentation will be part of the source code, it
will support conditionnal compilation as such. So the picture of available
option will fully correspond to the kernel you are running.

I hope to get a prototype of this for Xmas. The idea came when I was at a
customer site, without recent kernel source and I was trying to configure
a system with 3 3c509 ethernet adaptors with a modular kernel. I start
fiddling in /etc/conf.modules with lines like

alias eth0 3c509
options 3c509 io=0x300,0x320,0x340 irq=10,11,15

without success. Back at the office, it took a minute to find out that the
3c509 driver was not up to date like other ethernet module and only
allowed a single instance (single ethernet device) to be configured (And
you can't load the 3c509 module multiple time). It took another minutes to
fix it :-) and the result is part of 2.1.14 :-)

This is where I picked the idea of self documenting module, tied in the
source code.

--------------------------------------------------------
Jacques Gelinas (jacques@solucorp.qc.ca)
Linuxconf: The ultimate administration system for Linux.
see http://www.solucorp.qc.ca/linuxconf