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