xref: /openbsd-src/share/man/man8/boot_config.8 (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1.\"	$OpenBSD: boot_config.8,v 1.30 2016/03/10 09:04:11 jmc 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: March 10 2016 $
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 passing the
46.Fl c
47option, either from the firmware prompt or,
48depending on the architecture, when the bootstrap loader
49prompts for a kernel to boot:
50.Bd -literal
51>> OpenBSD/i386 BOOT 3.26
52.No "boot>" Ic boot -c
53booting hd0a:/bsd: ...
54\&...
55real mem  = 1073086464 (1023MB)
56avail mem = 1043189760 (994MB)
57User Kernel Config
58UKC>
59.Ed
60.Pp
61Changes made can be saved for the next reboot, by using
62.Xr config 8 .
63.Sh COMMANDS
64.Bl -tag -width "disable devno | dev"
65.It Ic add Ar dev
66Add a device through copying another.
67.It Ic base Cm 8 | 10 | 16
68Change the base of numbers displayed and entered.
69.It Ic change Ar devno | dev
70Modify one or more devices.
71.It Ic disable Ar devno | dev
72Disable one or more devices.
73.It Ic enable Ar devno | dev
74Enable one or more devices.
75.It Ic exit
76Continue boot.
77.It Ic find Ar devno | dev
78Find one or more devices.
79.It Ic help
80Give a short summary of all commands and their arguments.
81.It Ic list
82Show all known devices, a screen at a time.
83.It Ic lines Op Ar count
84Set the number of rows per page.
85.It Ic quit
86Continue boot.
87.It Ic show Op Ar attr Op Ar val
88Show all devices for which attribute
89.Ar attr
90has the value
91.Ar val .
92.It Ic timezone Op Ar minuteswest Op Ar dst
93Change the
94.Va tz
95timezone structure.
96.Va minuteswest
97is the number of minutes west of GMT and
98.Va dst
99is non-zero if Daylight Saving Time is in effect.
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.Bd -literal
112.No UKC> Ic find ne
11324 ne0 at isa0 port 0x240 size 0 iomem 0xd8000 iosiz 0 irq 9 drq -1 drq2 -1 flags 0x0
11425 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
11526 ne* at isapnp0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 flags 0x0
11627 ne* at pci* dev -1 function -1 flags 0x0
11728 ne* at pcmcia* function -1 irq -1 flags 0x0
118UKC>
119.Ed
120.Pp
121ne1 seems to match the configuration except it uses IRQ 5 instead of IRQ 10.
122So the irq on ne1 should be changed via the
123.Fa change
124command.
125The device can be specified by either name or number.
126.Bd -literal
127.No UKC> Ic change ne1
12825 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
129.No change (y/n) \&? Ic y
130.No port [0x300] \&?
131.No size [0] \&?
132.No iomem [-1] \&?
133.No iosiz [0] \&?
134.No irq [10] \&? Ic 5
135.No drq [-1] \&?
136.No drq2 [-1] \&?
137.No flags [0] \&?
13825 ne1 changed
13925 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 5 drq -1 drq2 -1 flags 0x0
140UKC>
141.Ed
142.Pp
143The show command is useful for finding which devices have a certain attribute.
144It can also be used to find those devices with a particular value for
145an attribute.
146.Bd -literal
147.No UKC> Ic show slot
148  2 ahc* at eisa0 slot -1 flags 0x0
149 10 uha* at eisa0 slot -1 flags 0x0
150 12 ep0 at eisa0 slot -1 flags 0x0
151 17 ep* at eisa0 slot -1 flags 0x0
152102 ahb* at eisa0 slot -1 flags 0x0
153103 fea* at eisa0 slot -1 flags 0x0
154.No UKC> Ic show port 0x300
155 25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
156 72 we1 at isa0 port 0x300 size 0 iomem 0xcc000 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
157 75 el0 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 9 drq -1 drq2 -1 flags 0x0
158 77 ie1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0
159UKC>
160.Ed
161.Pp
162It is possible to add new devices, but only devices that were linked into the
163kernel.
164If a new device is added, following devices will be renumbered.
165.Bd -literal
166.No UKC> Ic find ep
167 11 ep0 at isa0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 drq2 -1 flags 0x0
168 12 ep0 at eisa0 slot -1 flags 0x0
169 13 ep0 at pci* dev -1 function -1 flags 0x0
170 14 ep* at isapnp0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 flags 0x0
171 15 ep* at isa0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 drq2 -1 flags 0x0
172 16 ep* at eisa0 slot -1 flags 0x0
173 17 ep* at pci* dev -1 function -1 flags 0x0
174 18 ep* at pcmcia* dev -1 irq -1 flags 0x0
175.No UKC> Ic add ep1
176.No "Clone Device (DevNo, 'q' or '\&?') \&?" Ic 13
177.No "Insert before Device (DevNo, 'q' or '\&?')" Ic 14
178 14 ep1 at pci* dev -1 function -1
179.No UKC> Ic change 14
180 14 ep1 at pci* dev -1 function -1
181.No change (y/n) \&? Ic y
182.No dev [-1] \&? Ic 14
183.No function [-1] \&?
184.No flags [0] \&? Ic 18
185 14 ep1 changed
186 14 ep1 at pci* dev 14 function -1 flags 0x12
187UKC>
188.Ed
189.Pp
190When configuration is completed, booting can proceed by issuing the
191.Ic quit
192or
193.Ic exit
194commands.
195.Bd -literal
196.No UKC> Ic quit
197Continuing...
198mainbus0 (root)
199.Ed
200.Sh SEE ALSO
201.Xr config 8
202.Sh AUTHORS
203.An Mats O Jansson Aq Mt moj@stacken.kth.se
204.Sh BUGS
205The
206.Ic add
207command is rather restricted, and might be expanded in the future.
208