Konubinix' opinionated web of thoughts

Advanced Configuration and Power Interface

Fleeting

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.

https://en.wikipedia.org/wiki/ACPI

defines hardware abstraction interfaces between the device’s firmware (e.g. BIOS, UEFI), the computer hardware components, and the operating systems.[3

https://en.wikipedia.org/wiki/ACPI

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.

https://en.wikipedia.org/wiki/ACPI

ACPI has three main components: the ACPI tables, the ACPI BIOS, and the ACPI registers

https://en.wikipedia.org/wiki/ACPI

ACPI BIOS generates ACPI tables and loads ACPI tables into main memory

https://en.wikipedia.org/wiki/ACPI

ACPI Machine Language (AML)

https://en.wikipedia.org/wiki/ACPI

operating system must have an interpreter for the AML bytecode

https://en.wikipedia.org/wiki/ACPI

BIOS development time, AML bytecode is compiled from the ASL (ACPI Source Language) code.[8][9]

https://en.wikipedia.org/wiki/ACPI

November 2003, Linus Torvalds—author of the Linux kernel—described ACPI as “a complete design disaster in every way

https://en.wikipedia.org/wiki/ACPI

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

https://en.wikipedia.org/wiki/ACPI

tables allow description of system hardware in a platform-independent manner, and are presented as either fixed-formatted data structures or in AML

https://en.wikipedia.org/wiki/ACPI

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

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

DSDT - ArchWiki

DSDT (Differentiated System Description Table) is

https://wiki.archlinux.org/title/DSDT

supplies information about supported power events in a given system.

https://wiki.archlinux.org/title/DSDT

common Linux problem is missing ACPI functionality, such as: fans not running, screens not turning off when the lid is closed, etc.

https://wiki.archlinux.org/title/DSDT

can stem from DSDTs made with Windows specifically in mind, which can be patched after installation

https://wiki.archlinux.org/title/DSDT

Basically a DSDT table is the code run on ACPI (Power Management) events

https://wiki.archlinux.org/title/DSDT

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.

https://wiki.archlinux.org/title/DSDT

Even before attempting to fix your DSDT yourself, you can attempt a couple of different shortcuts:

https://wiki.archlinux.org/title/DSDT

Tell the kernel to report a version of Windows

https://wiki.archlinux.org/title/DSDT

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”

https://wiki.archlinux.org/title/DSDT

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).

https://wiki.archlinux.org/title/DSDT

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

https://wiki.archlinux.org/title/DSDT

case Microsoft’s compiler had been used, abbreviation INTL would instead be MSFT

https://wiki.archlinux.org/title/DSDT

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.

https://wiki.archlinux.org/title/DSDT