xref: /freebsd/share/man/man5/device.hints.5 (revision bdcbfde31e8e9b343f113a1956384bdf30d1ed62)
1.\" Copyright (c) 2001
2.\" Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer as
10.\"    the first lines of this file unmodified.
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.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.Dd November 19, 2019
27.Dt DEVICE.HINTS 5
28.Os
29.Sh NAME
30.Nm device.hints
31.Nd device resource hints
32.Sh DESCRIPTION
33The
34.Nm
35file is read in by the boot
36.Xr loader 8
37when the system is about to start, and its contents are
38passed to the kernel.
39It contains various variables to control the boot behavior of
40the kernel.
41These variables are typically
42.Dq device hints ,
43but can include any kernel tunable values.
44.Pp
45The file contains one variable per line.
46Lines starting with the
47.Ql #
48character are comments and are ignored by the boot loader.
49.Pp
50After the file is read by the boot loader, you may examine
51the variables with the
52.Ic show
53command, and may add a new variable, modify an existing one,
54or delete a variable with the
55.Ic set
56and
57.Ic unset
58commands of the boot loader
59(see
60.Xr loader 8 ) .
61.Pp
62After the system has started, you can dump these variables
63with the
64.Xr kenv 1
65command.
66.Sh DEVICE HINTS
67Device hint variables are used by device drivers to set up
68the device.
69They are most often used by ISA device drivers to specify
70where the driver will probe for the relevant devices, and what
71resources it will attempt to use.
72.Pp
73A device hint line looks like:
74.Pp
75.Sm off
76.D1 Li hint. Ar driver . Ar unit . Ar keyword Li = Qq Ar value
77.Sm on
78.Pp
79where
80.Ar driver
81is the name of a device driver,
82.Ar unit
83is the unit number, and
84.Ar keyword
85is the keyword of the hint.
86The keyword may be:
87.Pp
88.Bl -tag -width ".Li disabled" -compact -offset indent
89.It Li at
90specifies a bus to which the device is attached.
91.It Li port
92specifies the start address of I/O ports to be used by the device.
93.It Li portsize
94specifies the number of ports used by the device.
95.It Li irq
96is the interrupt line number to be used.
97.It Li drq
98is the DMA channel number.
99.It Li maddr
100specifies the physical memory address used by the device.
101.It Li msize
102specifies the physical memory size used by the device.
103.It Li flags
104sets various flag bits for the device.
105.It Li disabled
106can be set to
107.Qq 1
108to disable the device.
109.El
110.Pp
111A device driver may require one or more hint lines with these keywords,
112and may accept other keywords not listed here, through
113.Xr resource_int_value 9 .
114Consult individual device drivers' manual pages for available
115keywords and their possible values.
116.\" .Sh CONTROL VARIABLES
117.\" Lines not starting with
118.\" .Dq hint.
119.\" specify other control variables for the kernel.
120.\" They look:
121.\" .Pp
122.\" .Dl <name>="<value>"
123.\" XXX
124.\" WE SHOULD LIST AVAILABLE VARIABLE NAMES AND THEIR POSSIBLE VALUES HERE!
125.\" .Pp
126.Sh FILES
127.Bl -tag -width ".Pa /sys/ Ns Ar ARCH Ns Pa /conf/GENERIC.hints" -compact
128.It Pa /boot/device.hints
129Device resource hints file.
130.It Pa /sys/ Ns Ar ARCH Ns Pa /conf/GENERIC.hints
131Sample resource hints for the
132.Pa GENERIC
133kernel.
134.It Pa /sys/ Ns Ar ARCH Ns Pa /conf/NOTES
135Notes on the kernel configuration file and device resource hints.
136.El
137.Sh EXAMPLES
138The following example sets up resources for the
139.Xr uart 4
140driver on the ISA bus:
141.Bd -literal -offset indent
142hint.uart.0.at="isa"
143hint.uart.0.port="0x3F8"
144hint.uart.0.flags="0x10"
145hint.uart.0.irq="4"
146.Ed
147.Pp
148The following example disables the ACPI driver:
149.Bd -literal -offset indent
150hint.acpi.0.disabled="1"
151.Ed
152.Pp
153Setting a tunable variable:
154.Bd -literal -offset indent
155vm.pmap.pg_ps_enabled=1
156.Ed
157.Sh SEE ALSO
158.Xr kenv 1 ,
159.Xr loader.conf 5 ,
160.Xr loader 8 ,
161.Xr resource_int_value 9
162.Sh HISTORY
163The
164.Nm
165file first appeared in
166.Fx 5.0 .
167