Creating Model Configurations

To create a model configuration file for NBFC-Linux, you need to analyze the DSDT of your ACPI firmware to discover the registers and methods for controlling the fan.
This guide walks you through:

Introduction

About the Embedded Controller

Modern laptops rely on an Embedded Controller (EC) to manage a wide range of low-level hardware functions. These typically include keyboard, battery, power management, fan and thermal control, status LEDs, and display backlight control.

Caution When Writing to Registers

Accessing EC registers requires extreme care. Never experiment on registers or methods that are not clearly understood.

Safe System State During Configuration

When creating or testing a new configuration, the laptop should be in a state where no data can be lost. While interacting with the EC, the system may shut down unexpectedly or become unresponsive.

Battery Safety

For maximum safety, the laptop battery should be physically removed if possible. The Embedded Controller directly manages battery logic, and incorrect EC interaction can permanently damage or brick the battery.

Resetting the Embedded Controller

In most cases, a misconfigured Embedded Controller can be reset by fully rebooting the laptop, restoring it to its default state. This should not be relied upon as a safety mechanism — careful and deliberate EC interaction is essential.

Required Technical Skills

Interacting with the terminal and having a solid understanding of basic Unix commands is essential for following this guide. You should also be comfortable reading and modifying Bash scripts, as well as working with JSON configuration files. Familiarity with these tools is required to safely and effectively create and test model configurations.

Installing Required Tools

Install the following programs and kernel modules

Operating System Command
Arch Linux
sudo pacman -S acpica acpi_call stress
Debian
sudo apt install acpica-tools acpi-call stress
Fedora
sudo dnf install acpica-tools acpi_call stress
OpenSuse
sudo zypper install acpica acpi_call stress

Extracting the Firmware

Extract the binary ACPI tables

This will create the file dsdt.dat

sudo cat /sys/firmware/acpi/tables/DSDT > dsdt.dat

Generate the DSL file

This will create the file dsdt.dsl. You can view it with your favorite text editor.

iasl -d dsdt.dat

Analyzing the Firmware

Get a list of ACPI methods

acpiexec -b Methods dsdt.dat
Example Output
[...]
\_SB.PC00.LPCB.EC0._REG Method       0x5e8056d96f60 001 Args 2 Len 002D Aml 0x7564f4170c19
\_SB.PC00.LPCB.EC0.CMDW Method       0x5e8056d97050 001 Args 2 Len 004E Aml 0x7564f4170c4e
\_SB.PC00.LPCB.EC0.FANG Method       0x5e8056da2610 001 Args 1 Len 0009 Aml 0x7564f4171377
\_SB.PC00.LPCB.EC0.FANW Method       0x5e8056da2780 001 Args 2 Len 0008 Aml 0x7564f4171387
\_SB.PC00.LPCB.EC0.TUVR Method       0x5e8056da9940 001 Args 1 Len 0003 Aml 0x7564f4171396
\_SB.PC00.LPCB.EC0.THRO Method       0x5e8056da9a30 001 Args 1 Len 0005 Aml 0x7564f41713a0
\_SB.PC00.LPCB.EC0.CLCK Method       0x5e8056da9b20 001 Args 1 Len 0024 Aml 0x7564f41713ac
\_SB.PC00.LPCB.EC0.PCLK Method       0x5e8056da9c10 001 Args 0 Len 0004 Aml 0x7564f41713d7
\_SB.PC00.LPCB.EC0.ITHR Method       0x5e8056da9d00 001 Args 1 Len 0026 Aml 0x7564f41713e2
\_SB.PC00.LPCB.EC0.IPCL Method       0x5e8056da9df0 001 Args 0 Len 0010 Aml 0x7564f417140f
[...]

Get a list of registers

acpiexec -b 'Objects RegionField' dsdt.dat
Example Output
[...]
\_SB.PC00.LPCB.EC0.ERIB RegionField  0x60093e6470b0 001 Rgn [ECMM] Off 2E8 Len 10 Acc 01
\_SB.PC00.LPCB.EC0.SMST RegionField  0x60093e647120 001 Rgn [ECMM] Off 308 Len 08 Acc 01
\_SB.PC00.LPCB.EC0.SMAD RegionField  0x60093e647190 001 Rgn [ECMM] Off 310 Len 08 Acc 01
\_SB.PC00.LPCB.EC0.SMCM RegionField  0x60093e647200 001 Rgn [ECMM] Off 318 Len 08 Acc 01
\_SB.PC00.LPCB.EC0.SMD0 RegionField  0x60093e647270 001 Rgn [ECMM] Off 320 Len 100 Acc 01
\_SB.PC00.LPCB.EC0.BCNT RegionField  0x60093e6472e0 001 Rgn [ECMM] Off 420 Len 08 Acc 01
\_SB.PC00.LPCB.EC0.SMAA RegionField  0x60093e647350 001 Rgn [ECMM] Off 428 Len 18 Acc 01
[...]

The offset (Off) is specified in bits (hexadecimal). To convert the bit offset into a byte offset and bit position, we open python or ipython and divide the bit offset by 8 to obtain the byte offset, and use modulo 8 to determine the bit position:

~ > python
Python 3.13.5 (main, Jun 21 2025, 09:35:00) [GCC 15.1.1 20250425] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 0x2E8 // 8
93
>>> 0x2E8 % 8
0

This yields register number 93 and a bit offset of 0.

Finding Methods and Registers

When reading the DSDT, try to identify registers and methods with names like:

Registers: SFAN, CFAN, PFAN, FAN1, FSW1, FRDC, FTGC, RPM1, RPM2
Methods: FANG, FANW, GFSD, SFSD, SFNV, FRSP, STMM, GFRM

Probing Registers and Methods

You can access EC registers and invoke ACPI methods using the ec_probe tool:

Reading a register

sudo ec_probe read 0xD6

For a two-byte register:

sudo ec_probe read -w 0xD6

Writing to a register

sudo ec_probe write 0xD7 0x0

For a two-byte register:

sudo ec_probe write -w 0xD7 0xDEAD

Calling ACPI methods

You can also invoke ACPI methods:

sudo ec_probe acpi_call '\_SB.PCI0.LPCB.EC0.GFSD'

With arguments:

sudo ec_probe acpi_call '\_SB.PCI0.LPCB.EC0.SFSD' 100

Examples

Below are real-world examples, along with a detailed explanation of how the configuration files were created.

Model Registers Methods
ASUSTeK COMPUTER INC. X5511CA \_SB.PCI0.LPCB.EC0.RRAM 6151 (read), \_SB.PCI0.LPCB.EC0.SFNV 1 $ (write)
Acer Aspire E1-570G \_SB_.PCI0.LPCB.EC0.FANG 33026 (read), \_SB_.PCI0.LPCB.EC0.FANW 33026 $ (write), \_SB_.PCI0.LPCB.EC0.FANW 33030 0xFF (misc)
Acer Aspire ES1-711 0x55 (read+write), CTMP (misc)
HP 620 CFAN (read), PFAN (write)
HP EliteBook 8560w FRDC (read), FTGC (write), CRZN (misc), TEMP (misc)
HP Laptop 17-bs0xx FAN1 (read), FSW1 (write), FSH1 (misc)
HP Pavilion 17 Notebook PC SFAN (write) \_TZ.TZ01.FRSP (read)
Packard Bell EasyNote TK85 \_SB.PCI0.LPCB.EC0.FANG 33026 (read), \_SB.PCI0.LPCB.EC0.FANW 33026 $ (write)