implementation of boot-time kernel parameters

From: Robert P. J. Day
Date: Mon Jun 18 2007 - 07:27:39 EST



(i asked about this on the KJ list but didn't get much in the way of
response, so i'll try here.)

the short form: as a lead-in to trying to clean up some obsolete
content in Documentation/kernel-parameters.txt (and there appears to
be a lot of it), i can see how boot-time kernel parms are defined
these days -- with "__setup()" or "early_param()".

i'm also aware of an older and (apparently) LILO-specific way to do
it -- using something like "pas16=" where the appropriate driver code
has to parse the value string (eg., in drivers/scsi/pas16.c):

/*
* Function : pas16_setup(char *str, int *ints)
*
* Purpose : LILO command line initialization of the overrides array,
*
* Inputs : str - unused, ints - array of integer parameters with ints[0]
* equal to the number of ints.
*
*/

void __init pas16_setup(char *str, int *ints)
{
static int commandline_current = 0;
int i;
if (ints[0] != 2)
printk("pas16_setup : usage pas16=io_port,irq\n");
else
if (commandline_current < NO_OVERRIDES) {
overrides[commandline_current].io_port = (unsigned short) ints[1];
overrides[commandline_current].irq = ints[2];
for (i = 0; i < NO_BASES; ++i)
if (bases[i].io_port == (unsigned short) ints[1]) {
bases[i].noauto = 1;
break;
}
++commandline_current;
}
}

now, the pas16 driver also handles setting those values as module
parameters:

#ifdef MODULE
module_param(pas16_addr, ushort, 0);
module_param(pas16_irq, int, 0);
#endif

but there are definitely drivers that support *only* the LILO form
for boot-time parms, which would seem to suggest that, unless you're
using LILO, you don't get some of those kernel parameters, no?

in situations like that, is it even accurate to say that those are
supported kernel parameters if they're not supported on non-LILO
systems? and how should stuff like this be brought up to date, if at
all?

rday

p.s. note that the comment at the top of the doc file reads:

Kernel Parameters
~~~~~~~~~~~~~~~~~

The following is a consolidated list of the kernel parameters as
implemented (mostly) by the __setup() macro ...

which, as i'm sure you can appreciate, is somewhat misleading since
some of the parms are relevant only for LILO-based systems. anyway,
is there a standard for all of this?
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/