[20070618]
|
Kernel-tuning without recompiling
NetBSD's i386 GENERIC kernel has ACPI enabled nowadays.
Given that there's more than enough (i386ish) hardware out there that
plainly doesn't work with ACPI, it's sort of inconvenient to
have the default kernel not work. Possible workarounds for this
situation are offering a kernel that has ACPI disabled (like
the GENERIC_NOACPI kernel that I've added just in time for
NetBSD 4.0), or using userconf to disable ACPI[1]. The drawback
is that you either need a special kernel, or that it's not permanent.
A possible solution is available in OpenBSD's config(8) command:
By running "config -e /kernel", userconf commands can be "saved"
into the kernel binary, preventing the need to re-run userconf
on every boot.
Jared McNeill has
proposed
another approach for NetBSD now:
Instead of modifying the kernel binary, have the bootloader read
a list of (userconf) commands, and have the kernel execute them
automatically.
Instead of introducing yet another config file format,
Jared has opted for (re)using the
proplib API functions
to load the config file from disk and pass it on to the kernel.
Those crying "YEEK, XML!" now can rest assured: there's a policy in
NetBSD that XML is not used for config files that the user needs to
edit, and the idea is to use userconf as usual, then
dump the settings to the config file and use
that on the next boot, see
Jared's second patch
for the most recent code version.
With this scheme, there's a common file where boot-time information
can be stored, and the eventual idea is not only to have all ports'
bootloaders read that file, but also store further information into
the file to make settings other than those available via userconf
today:
Jared's ideas
include storing bootloader settings (timeout, serial console speed, ...)
and kernel tuneables like PCI_*_FIXUPs in there. I guess we can stay tuned
to see what will happen on this front!
[1] What is userconf? Make sure you have "options USERCONF" in your
kernel, then interrupt the bootloader and type "boot -c". You can
then type "disable acpi" to, well, disable ACPI. It works for other
drivers as well, but it won't be persistant and has to be done
on every boot.
[Tags: kernel, proplib, userconf]
|