BOOT_CONFIG(8)
π BOOT_CONFIG(8) β like, how to change your kernel config at boot, bestie
okay so this is the boot_config manual page β System Manager's Manual energy, and it's literally your guide to poking at the kernel config before the kernel even finishes waking up. main character energy fr fr π
β¨ NAME β¨
boot_config β the whole "how to change kernel configuration at boot" situation π¦
πΈ DESCRIPTION πΈ
BOOT_CONFIG is a kernel option that makes it possible to change the configuration at boot time. no cap. and the same interface is available from userland too, using the -e argument to config(8). iykyk π
So the boot-time config gets invoked by passing the -c option β either from the firmware prompt, or, depending on the architecture, when the bootstrap loader prompts you for a kernel to boot:
>> OpenBSD/i386 BOOT 3.26
boot> boot -c
booting hd0a:/bsd: ...
...
real mem = 1073086464 (1023MB)
avail mem = 1043189760 (994MB)
User Kernel Config
UKC>
Changes made can be saved for the next reboot, by using config(8). BUT β and this is the important part, bestie β those changes would not persist across system upgrades and would prevent kernel relinking π. To make sure your changes get carried over to upgraded kernels, they can be saved to the bsd.re-config(5) configuration file. slay π
π COMMANDS π
add devβ add a device through copying another. iconic cloning behaviour π§base 8 | 10 | 16β change the base of numbers displayed and entered.change devno | devβ modify one or more devices.disable devno | devβ disable one or more devices.enable devno | devβ enable one or more devices.exitβ continue boot. bye bestie π«Άfind devno | devβ find one or more devices.helpβ give a short summary of all commands and their arguments.listβ show all known devices, a screen at a time.lines [count]β set the number of rows per page.quitβ continue boot.show [attr [val]]β show all devices for which attribute attr has the value val.verboseβ toggle the autoconfig verbose variable.
π₯ EXAMPLES π₯
π the ethernet card saga
So the Ethernet card is not detected at boot because the kernel configuration does not match the physical hardware configuration β e.g. wrong IRQ in OpenBSD/i386. and the Ethernet card is supposed to use the ne(4) driver. classic π
UKC> find ne
24 ne0 at isa0 port 0x240 size 0 iomem 0xd8000 iosiz 0 irq 9 drq -1 drq2 -1 flags 0x0
25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
26 ne* at isapnp0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 flags 0x0
27 ne* at pci* dev -1 function -1 flags 0x0
28 ne* at pcmcia* function -1 irq -1 flags 0x0
UKC>
ne1 seems to match the configuration except it uses IRQ 5 instead of IRQ 10. so the irq on ne1 should be changed via the change command. the device can be specified by either name or number, either way works π
UKC> change ne1
25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
change (y/n) ? y
port [0x300] ?
size [0] ?
iomem [-1] ?
iosiz [0] ?
irq [10] ? 5
drq [-1] ?
drq2 [-1] ?
flags [0] ?
25 ne1 changed
25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 5 drq -1 drq2 -1 flags 0x0
UKC>
π¦ the show command
the show command is useful for finding which devices have a certain attribute. it can also be used to find those devices with a particular value for an attribute. double duty queen π
UKC> show slot
2 ahc* at eisa0 slot -1 flags 0x0
10 uha* at eisa0 slot -1 flags 0x0
12 ep0 at eisa0 slot -1 flags 0x0
17 ep* at eisa0 slot -1 flags 0x0
102 ahb* at eisa0 slot -1 flags 0x0
103 fea* at eisa0 slot -1 flags 0x0
UKC> show port 0x300
25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
72 we1 at isa0 port 0x300 size 0 iomem 0xcc000 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
75 el0 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 9 drq -1 drq2 -1 flags 0x0
77 ie1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
UKC>
π adding a whole new device
it is possible to add new devices, but only devices that were linked into the kernel. that's the catch, bestie. and if a new device is added, following devices will be renumbered π
UKC> find ep
11 ep0 at isa0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 drq2 -1 flags 0x0
12 ep0 at eisa0 slot -1 flags 0x0
13 ep0 at pci* dev -1 function -1 flags 0x0
14 ep* at isapnp0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 flags 0x0
15 ep* at isa0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 drq2 -1 flags 0x0
16 ep* at eisa0 slot -1 flags 0x0
17 ep* at pci* dev -1 function -1 flags 0x0
18 ep* at pcmcia* dev -1 irq -1 flags 0x0
UKC> add ep1
Clone Device (DevNo, 'q' or '?') ? 13
Insert before Device (DevNo, 'q' or '?') 14
14 ep1 at pci* dev -1 function -1
UKC> change 14
14 ep1 at pci* dev -1 function -1
change (y/n) ? y
dev [-1] ? 14
function [-1] ?
flags [0] ? 18
14 ep1 changed
14 ep1 at pci* dev 14 function -1 flags 0x12
UKC>
β finishing up
when configuration is completed, booting can proceed by issuing the quit or exit commands. go forth, bestie πΈ
UKC> quit
Continuing...
mainbus0 (root)
π SEE ALSO π
bsd.re-config(5)config(8)
π AUTHORS π
Mats O Jansson <moj@stacken.kth.se> β the icon who made this π«Ά
β¨ that's the whole vibe β¨ β this beauty came from the Debian edition of the System Manager's Manual, dated May 5, 2025, and it's BOOT_CONFIG(8) all the way down. mwah π
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 1996 Mats O Jansson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms