DEVICE.HINTS(5)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’– DEVICE.HINTS(5) πŸ’–

okay bestie, so this is a File Formats Manual page for device.hints β€” literally the "device resource hints" file. buckle up, it's iconic πŸŽ€


✨ NAME ✨

device.hints β€” device resource hints πŸ¦‹


🌸 DESCRIPTION 🌸

so the device.hints file gets read in by the boot loader(8) right when the system is about to start, and everything inside it gets passed straight to the kernel. no cap. it holds all these variables that control the boot behavior of the kernel β€” usually they're "device hints", but honestly they can be any kernel tunable values. versatile queen πŸ‘‘

the file is literally one variable per line. lines that start with the # character are comments and the boot loader just ignores them, like it's scrolling past drama it doesn't care about πŸ’…

after the file gets read by the boot loader, you can totally examine the variables with the show command, and you can add a new variable, modify an existing one, or delete a variable with the set and unset commands of the boot loader (peep loader(8), iykyk).

and once the system has started? you can dump all those variables with the kenv(1) command. slay. πŸ”₯


πŸ‘‘ DEVICE HINTS πŸ‘‘

device hint variables are what device drivers use to set up the device. most often they're used by ISA device drivers to specify where the driver will probe for the relevant devices, and what resources it'll attempt to use. it's giving matchmaker but for hardware and resources 🫢

a device hint line looks like this:

hint.driver.unit.keyword="value"

where driver is the name of a device driver, unit is the unit number, and keyword is the keyword of the hint. and the keyword may be:

  • at β€” specifies a bus to which the device is attached.
  • port β€” specifies the start address of I/O ports to be used by the device.
  • portsize β€” specifies the number of ports used by the device.
  • irq β€” is the interrupt line number to be used.
  • drq β€” is the DMA channel number.
  • maddr β€” specifies the physical memory address used by the device.
  • msize β€” specifies the physical memory size used by the device.
  • flags β€” sets various flag bits for the device.
  • disabled β€” can be set to "1" to disable the device. (rude but effective πŸ’€)

a device driver may require one or more hint lines with these keywords, and it may also accept other keywords that aren't listed here, through resource_int_value(9). so pls consult the individual device drivers' manual pages for the available keywords and their possible values. don't just guess, bestie πŸ™ˆ


πŸŽ€ FILES πŸŽ€

  • /boot/device.hints β€” Device resource hints file.
  • /sys/ARCH/conf/GENERIC.hints β€” Sample resource hints for the GENERIC kernel.
  • /sys/ARCH/conf/NOTES β€” Notes on the kernel configuration file and device resource hints.

🌈 EXAMPLES 🌈

ok so this first one sets up resources for the uart(4) driver on the ISA bus. look at her go:

hint.uart.0.at="isa"
hint.uart.0.port="0x3F8"
hint.uart.0.flags="0x10"
hint.uart.0.irq="4"

and this one? it just straight up disables the ACPI driver. sorry to that driver 😭

hint.acpi.0.disabled="1"

and here's how you set a tunable variable:

vm.pmap.pg_ps_enabled=1

πŸ¦‹ SEE ALSO πŸ¦‹

kenv(1), loader.conf(5), loader(8), resource_int_value(9)


⭐ HISTORY ⭐

the device.hints file first appeared in FreeBSD 5.0. a true icon since day one πŸ’œ


and that's the whole page, bestie!! this one's from Debian, dated November 19, 2019 β€” so go forth and hint responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from