Drivers on FreeBSDLast update: 10.04.2021
By default, FreeBSD does not load all possible drivers; it must be instructed to load the drivers specific to our hardware.
For example, for a list of unloaded drivers, we can use the following command:
root #: dmesg | grep "no driver attached"
root #: dmesg | grep "no driver attached" pci12: <network> at device 0.0 (no driver attached) pci0: <multimedia, HDA> at device 27.0 (no driver attached) pci0: <serial bus, SMBus> at device 31.3 (no driver attached) pci9: <base peripheral, SD host controller> at device 0.1 (no driver attached) pci9: <mass storage> at device 0.2 (no driver attached)
What stands out here: an audio chip (multimedia HDA), a network card, the WLAN in my case (network), an SMBus chipset (serial bus, SMBus) and an SD card reader.
Loading the driver of the SD card reader
root #: sysrc kld_list + = "mmc mmcsd sdhci"
The most common audio drivers have been enabled by default since 9.0. If it doesn't, we load a "meta" driver that loads all of the audio drivers, and then we look at the one that is accepted:
root #: kldload snd_driver root #: cat /dev/sndstat FreeBSD Audio Driver (newpcm: 64bit 2007061600 / amd64) Installed devices: pcm0: <Intel 82801H High Definition Audio Controller> at memory 0xf6dfc000 irq 21 kld snd_hda [20080420_0052] [MPSAFE] (1p: 1v / 1r: 1v channels duplex default)
In this case, the snd_hda drivers match. This driver has been included as standard in the generic kernel since version 9.0, but for an older version, loading must be declared using the old method:
root #: sysrc kld_list + = "snd_hda"
Or, since 9.0, adding its name to the kld_list variable in the /etc/rc.conf file.
To use the loudspeakers / Bluetooth headsets, these must be transferred via the virtual_oss package. We can install the whole thing with the following command:
root #: pkg install virtual_oss virtual_oss_ctl
We load and check whether the driver was loaded correctly:
[root @ laptop] ~ #: kldload ichsmb [root @ laptop] ~ #: dmesg | grep smbus smbus0: <System Management Bus> on ichsmb0
We add this module to the list of modules to be loaded automatically:
root #: sysrc kld_list + = "smbus"
Very useful on laptops, there are ACPI modules that are manufacturer-specific. Here is the list of modules available on FreeBSD 11:
|acpi_asus.ko||Asus laptop extras|
|acpi_dock.ko||Laptop docking station device driver|
|acpi_fujitsu.ko||Fujitsu laptop extras|
|acpi_hp.ko||ACPI extras driver for HP laptops|
|acpi_ibm.ko||ACPI extras driver for IBM laptops|
|acpi_panasonic.ko||ACPI hotkey driver for Panasonic laptops|
|acpi_sony.ko||ACPI notebook controller driver for Sony laptops|
|acpi_toshiba.ko||Toshiba HCI interface|
|acpi_video.ko||ACPI Video Extensions driver|
|acpi_wmi.ko||ACPI to WMI mapping driver (loaded by others if necessary)|
To add the variable kld_load based on our hardware. For example, for my IBM laptop I have: acpi_ibm and acpi_video.
Power saving mode
This saves the battery:
root #: echo "hw.pci.do_power_nodriver = 3" >> /etc/sysctl.conf