How to modify bits in EC of a laptop on BSD?

167 Views Asked by At

I am a new user trying to make BSD as my daily driver. Apparently, the only thing stopping me is unable to control the fan. I am using Gigabyte Aero 10th Gen Intel Core i7 with NVIDIA GTX 1660Ti card. It has pre-defined fan curve settings like normal, gaming, quiet etc. I need to turn on a profile based on what I am working on, e.g., I set it to gaming when I am compiling code or rendering video. But I set it to normal other times, as it sounds like a jet engine. I was surprised when everything is working fine out of the box except the fan. Currently, I am using Fedora where I control fans through writing bits on EC using c program uses ec_sys of Linux.

My laptop gets pretty hot but, I don't want to set any limit on the CPU frequency. I came to the conclusion that my laptop's fans cannot be controlled through ACPI (or I am not capable of). Furthermore, I explored and tried all possible solutions, such as Arch's documentation or any other code regarding fan control. I tried to create an account in the forum but neither Gmail nor ProtonMail is working during registration, I don't know what is wrong! Thank you for the time and consideration.

1

There are 1 best solutions below

1
Valery S. On

BSD family doesn't implement an ACPI sensor framework, so for the fan control, unlike with Linux which provides lm-sensors Some server's motherboard implement IPMI, which has driver and tools on FreeBSD, but I doubt you can use it with the system you described here. You will get more information here on the Unix SE: freebsd-kernel-module-to-control-fan, you will find many ways to access the cooling system, and you can gather some infos through dmidecode -t 27 (SMBIOS spec. type 27 : Cooling Device). Programmatically on FreeBSD, accessing and modifying kernel state is done through sys/sysctl.h API, and using sysctl call with a mib_vector type array. If you want some help on this, plz provide a more accurate question.