1.\" $OpenBSD: boot_config.8,v 1.28 2014/01/20 00:55:35 schwarze Exp $ 2.\" 3.\" Copyright (c) 1996 Mats O Jansson 4.\" All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 4. Neither the name of the author nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.Dd $Mdocdate: January 20 2014 $ 31.Dt BOOT_CONFIG 8 32.Os 33.Sh NAME 34.Nm boot_config 35.Nd how to change kernel configuration at boot 36.Sh DESCRIPTION 37.Nm BOOT_CONFIG 38is a kernel option that makes it possible to change the configuration 39at boot time. 40The same interface is available from userland, using the 41.Fl e 42argument to 43.Xr config 8 . 44.Pp 45The boot time configuration is invoked by the 46.Fl c 47option when 48.Ox 49prompts for a kernel to boot: 50.Bd -literal 51>> OpenBSD BOOT 640/31744 k [1.29] 52use ? for file list, or carriage return for defaults 53use hd(1,a)/bsd to boot sd0 when sd0 is also installed 54.No "Boot: [[[wd(0,a)]/bsd][-abcdrs]] :" Ic -c 55Booting... 56avail mem = 28188672 57using 430 buffers containing 1761280 bytes of memory 58User Kernel Config 59UKC> 60.Ed 61.Pp 62Changes made can be saved for the next reboot, by using 63.Xr config 8 . 64.Sh COMMANDS 65.Bl -tag -width "disable devno | dev" 66.It Ic add Ar dev 67Add a device through copying another. 68.It Ic base Cm 8 | 10 | 16 69Change the base of numbers displayed and entered, 70e.g. I/O addresses in a VAXen are octal. 71.It Ic change Ar devno | dev 72Modify one or more devices. 73.It Ic disable Ar devno | dev 74Disable one or more devices. 75.It Ic enable Ar devno | dev 76Enable one or more devices. 77.It Ic exit 78Continue boot. 79.It Ic find Ar devno | dev 80Find one or more devices. 81.It Ic help 82Give a short summary of all commands and their arguments. 83.It Ic list 84Show all known devices, a screen at a time. 85.It Ic lines Op Ar count 86Set the number of rows per page. 87.It Ic quit 88Continue boot. 89.It Ic show Op Ar attr Op Ar val 90Show all devices for which attribute 91.Ar attr 92has the value 93.Ar val . 94.It Ic timezone Op Ar minuteswest Op Ar dst 95Change the 96.Va tz 97timezone structure. 98.Va minuteswest 99is the number of minutes west of GMT and 100.Va dst 101is non-zero if Daylight Saving Time is in effect. 102Without arguments, displays its current value. 103.It Ic verbose 104Toggle the autoconfig verbose variable. 105.El 106.Sh EXAMPLES 107The Ethernet card is not detected at boot because the kernel configuration 108does not match the physical hardware configuration, 109e.g. wrong IRQ in OpenBSD/i386. 110The Ethernet card is supposed to use the 111.Xr ne 4 112driver. 113.Bd -literal 114.No UKC> Ic find ne 11524 ne0 at isa0 port 0x240 size 0 iomem 0xd8000 iosiz 0 irq 9 drq -1 drq2 -1 flags 0x0 11625 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0 11726 ne* at isapnp0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 flags 0x0 11827 ne* at pci* dev -1 function -1 flags 0x0 11928 ne* at pcmcia* function -1 irq -1 flags 0x0 120UKC> 121.Ed 122.Pp 123ne1 seems to match the configuration except it uses IRQ 5 instead of IRQ 10. 124So the irq on ne1 should be changed via the 125.Fa change 126command. 127The device can be specified by either name or number. 128.Bd -literal 129.No UKC> Ic change ne1 13025 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0 131.No change (y/n) \&? Ic y 132.No port [0x300] \&? 133.No size [0] \&? 134.No iomem [-1] \&? 135.No iosiz [0] \&? 136.No irq [10] \&? Ic 5 137.No drq [-1] \&? 138.No drq2 [-1] \&? 139.No flags [0] \&? 14025 ne1 changed 14125 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 5 drq -1 drq2 -1 flags 0x0 142UKC> 143.Ed 144.Pp 145The show command is useful for finding which devices have a certain attribute. 146It can also be used to find those devices with a particular value for 147an attribute. 148.Bd -literal 149.No UKC> Ic show slot 150 2 ahc* at eisa0 slot -1 flags 0x0 151 10 uha* at eisa0 slot -1 flags 0x0 152 12 ep0 at eisa0 slot -1 flags 0x0 153 17 ep* at eisa0 slot -1 flags 0x0 154102 ahb* at eisa0 slot -1 flags 0x0 155103 fea* at eisa0 slot -1 flags 0x0 156.No UKC> Ic show port 0x300 157 25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0 158 72 we1 at isa0 port 0x300 size 0 iomem 0xcc000 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0 159 75 el0 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 9 drq -1 drq2 -1 flags 0x0 160 77 ie1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0 161UKC> 162.Ed 163.Pp 164It is possible to add new devices, but only devices that were linked into the 165kernel. 166If a new device is added, following devices will be renumbered. 167.Bd -literal 168.No UKC> Ic find ep 169 11 ep0 at isa0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 drq2 -1 flags 0x0 170 12 ep0 at eisa0 slot -1 flags 0x0 171 13 ep0 at pci* dev -1 function -1 flags 0x0 172 14 ep* at isapnp0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 flags 0x0 173 15 ep* at isa0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 drq2 -1 flags 0x0 174 16 ep* at eisa0 slot -1 flags 0x0 175 17 ep* at pci* dev -1 function -1 flags 0x0 176 18 ep* at pcmcia* dev -1 irq -1 flags 0x0 177.No UKC> Ic add ep1 178.No "Clone Device (DevNo, 'q' or '\&?') \&?" Ic 13 179.No "Insert before Device (DevNo, 'q' or '\&?')" Ic 14 180 14 ep1 at pci* dev -1 function -1 181.No UKC> Ic change 14 182 14 ep1 at pci* dev -1 function -1 183.No change (y/n) \&? Ic y 184.No dev [-1] \&? Ic 14 185.No function [-1] \&? 186.No flags [0] \&? Ic 18 187 14 ep1 changed 188 14 ep1 at pci* dev 14 function -1 flags 0x12 189UKC> 190.Ed 191.Pp 192When configuration is completed, booting can proceed by issuing the 193.Ic quit 194or 195.Ic exit 196commands. 197.Bd -literal 198.No UKC> Ic quit 199Continuing... 200mainbus0 (root) 201.Ed 202.Sh SEE ALSO 203.Xr config 8 204.Sh AUTHORS 205.An Mats O Jansson Aq Mt moj@stacken.kth.se 206.Sh BUGS 207The 208.Ic add 209command is rather restricted, and might be expanded in the future. 210