Advanced Configuration and Power Interface
Fleeting- External reference: https://docs.kernel.org/firmware-guide/acpi/video_extension.html
- External reference: https://wiki.ubuntu.com/Kernel/Reference/ACPITricksAndTips
- External reference: https://en.wikipedia.org/wiki/ACPI
ACPI - Wikipedia
Advanced Configuration and Power Interface (ACPI) is an open standard that operating systems can use to discover and configure computer hardware components, to perform power management (e.g. putting unused hardware components to sleep), auto configuration (e.g. Plug and Play and hot swapping), and status monitoring.
defines hardware abstraction interfaces between the device’s firmware (e.g. BIOS, UEFI), the computer hardware components, and the operating systems.[3
ACPI advertises the available components and their functions to the operating system kernel using instruction lists (“methods”) provided through the system firmware (UEFI or BIOS), which the kernel parses. ACPI then executes the desired operations written in ACPI Machine Language (such as the initialization of hardware components) using an embedded minimal virtual machine.
ACPI has three main components: the ACPI tables, the ACPI BIOS, and the ACPI registers
ACPI BIOS generates ACPI tables and loads ACPI tables into main memory
ACPI Machine Language (AML)
operating system must have an interpreter for the AML bytecode
BIOS development time, AML bytecode is compiled from the ASL (ACPI Source Language) code.[8][9]
November 2003, Linus Torvalds—author of the Linux kernel—described ACPI as “a complete design disaster in every way
ACPI Component Architecture (ACPICA), mainly written by Intel’s engineers, provides an open-source platform-independent reference implementation of the operating system–related ACPI code.[12
tables allow description of system hardware in a platform-independent manner, and are presented as either fixed-formatted data structures or in AML
many varieties of ACPI tables, but they break into two main categories - configuration data and ACPI Machine Language (AML) byte code.
— https://wiki.ubuntu.com/Kernel/Reference/ACPITricksAndTips
driver is responsible for locating and extracting data from the ACPI tables and interpreting it in a way that conforms to the specification
— https://wiki.ubuntu.com/Kernel/Reference/ACPITricksAndTips
ACPI is a heavily overly engineered solution, however it is powerful because it provides an abstract view of how to control machine specific hardware to any operating system
— https://wiki.ubuntu.com/Kernel/Reference/ACPITricksAndTips
major downside is that most firmware vendors engineer ACPI to match with a very Microsoft centric implementation of ACPI which at times is a little lax in some areas and does not fully conform to the ACPI specification
— https://wiki.ubuntu.com/Kernel/Reference/ACPITricksAndTips
example, to be able to query the current backlight brightness level, the vendor writes an AML method called _BQC (Backlight Query Current) which returns the level.
— https://wiki.ubuntu.com/Kernel/Reference/ACPITricksAndTips
method could be implemented in many different ways, for example, just reading a value from the Embedded Controller’s memory, or maybe it jumps into the BIOS to fetch information using a System Management Mode service
— https://wiki.ubuntu.com/Kernel/Reference/ACPITricksAndTips
kernel has no idea of how the method is implemented - it just executes the AML byte code which has full access to I/O regions and memory to allow it to interact with the hardware.
— https://wiki.ubuntu.com/Kernel/Reference/ACPITricksAndTips
Timing issues - e.g. interacting with the Embedded Controller, mis-timed read/writes. AML may execute correctly in Windows but not in Linux because of the different speed AML operations are being executed in different host operating systems
— https://wiki.ubuntu.com/Kernel/Reference/ACPITricksAndTips
If the ACPI table has a video device, and acpi_backlight=vendor kernel command line is not present, the driver will register a backlight device and set the required backlight operation structure for it for the sysfs interface control. For every registered class device, there will be a directory named acpi_videoX under /sys/class/backlight
— https://docs.kernel.org/firmware-guide/acpi/video_extension.html
what ACPI video driver does is:
actual_brightness:on read, control method _BQC will be evaluated to get the brightness level the firmware thinks it is at;
bl_power:not implemented, will set the current brightness instead;
brightness:on write, control method _BCM will run to set the requested brightness level;
max_brightness:Derived from the _BCL package(see below);
type:firmware
— https://docs.kernel.org/firmware-guide/acpi/video_extension.html
ACPI Component Architecture
- External reference: https://www.intel.com/content/www/us/en/developer/topic-technology/open/acpica/overview.html
Overview of ACPI Component Architecture
ACPI Component Architecture (ACPICA) is a reference implementation of the Advanced Configuration and Power Interface (ACPI) specification. This implementation simplifies complex ACPI operating system implementations by integrating it directly as a kernel-resident subsystem, without changes to the core ACPICA code.
— https://www.intel.com/content/www/us/en/developer/topic-technology/open/acpica/overview.html
Differentiated System Description Table
- External reference: https://wiki.archlinux.org/title/DSDT
DSDT - ArchWiki
DSDT (Differentiated System Description Table) is
supplies information about supported power events in a given system.
common Linux problem is missing ACPI functionality, such as: fans not running, screens not turning off when the lid is closed, etc.
can stem from DSDTs made with Windows specifically in mind, which can be patched after installation
Basically a DSDT table is the code run on ACPI (Power Management) events
possible that the hardware manufacturer has released an updated firmware which fixes ACPI related problems. Installing an updated firmware is often preferred over this method because it would avoid duplication of effort.
Even before attempting to fix your DSDT yourself, you can attempt a couple of different shortcuts:
Tell the kernel to report a version of Windows
other strings to test:
“Microsoft Windows XP” “Microsoft Windows 2000” “Microsoft Windows 2000.1” “Microsoft Windows ME: Millennium Edition” “Windows 2001” “Windows 2006” “Windows 2009” “Windows 2012” when all that fails, you can even try “Linux”
DSDT file is originally written in ACPI Source language (an .asl/.dsl file). Using a compiler this can produce an ‘ACPI Machine Language’ file (.aml) or a hex table (.hex).
What compiled the original code? Check if your system’s DSDT was compiled using Intel or Microsoft compiler:
ACPI: DSDT 00000000bf7e5000 0A35F (v02 Intel CALPELLA 06040000 INTL 20060912) ACPI: EC: Look up EC in DSDT
case Microsoft’s compiler had been used, abbreviation INTL would instead be MSFT
ACPICA component of the kernel can handle most of the trivial errors you get while compiling the DSDT. So do not fret yourself over compile errors if your system is working the way it should.