ACPI Debugging on Ubuntu: Hands-On acpidbg Guide

Overview

Diagnosing hardware power states and analyzing low-level firmware tables in Ubuntu requires direct access to kernel diagnostic utilities. This walkthrough explores practical applications of acpidbg, guiding systems engineers through mounting kernel debug endpoints, interacting with the runtime AML debugger, and extracting ACPI tables for static disassembly.

Setting Up Tooling and Validating Debug Environments

Begin by installing the fundamental diagnostic suites—acpidump, acpica-tools, and linux-tools-common—to supply both userland disassemblers and kernel execution bridges.

Installing ACPI diagnostic and kernel tool packages via apt

The acpidbg utility establishes an interactive pipeline directly into the kernel’s internal ACPI interpreter. Verify whether the binary exists locally; if missing, resolve dependencies against the matching kernel tool metapackage.

⚙️ [Core Flags]

-b : Launches the AML debugger interface in non-interactive batch processing mode.
-f : Loads an external script file populated with pre-staged AML diagnostic directives.

Verifying acpidbg availability and installing kernel-matched packages

Query the active kernel build string using uname -r to pinpoint the exact release profile your system currently boots.

Checking active Linux kernel release version

Next, audit /sys/kernel/debug/acpi to check whether the ACPI debug control nodes are already exposed via debugfs.

Auditing the ACPI directory structure under sysfs debugfs

Mounting debugfs and Exposing the ACPI Debugger Interface

Interactive debugging relies on the kernel’s virtual debug filesystem. Mount debugfs at its conventional mount point if it has not been automatically initialized by your init system.

Mounting debugfs onto /sys/kernel/debug

Confirm that the ACPI-specific subsystem tree within debugfs is now readable and accessible by privileged users.

Verifying debugfs ACPI directory accessibility

Initialize the in-kernel AML debugger module by loading acpi_dbg, which exposes the bidirectional communication pipe needed for userland debugging.

Loading the acpi_dbg kernel module

Ensure the character interface node /sys/kernel/debug/acpi/acpidbg is active and ready to process commands.

Confirming readiness of the acpidbg character device node

Querying acpidbg Syntax and Executing Automated Commands

Inspect the argument parsing syntax and basic invocation flags of the tool using the standard help switch.

Viewing acpidbg CLI flags and usage text

Rather than maintaining a persistent terminal session, pipe standard text commands directly into the debugger process. This demonstrates how scripts can orchestrate headless AML diagnostics.

Piping the help instruction into acpidbg via stdin

Validate the operational state and version handshake of the kernel’s ACPI subsystem by dispatching a batch version request through standard input.

Retrieving ACPICA subsystem and AML debugger version strings

Extracting Firmware Tables and Decompiling AML Code

Allocate an isolated scratch directory to store extracted binary blobs and decompiled source files.

Creating a dedicated workspace for ACPI table analysis

Capture the raw binary payload of the primary DSDT (Differentiated System Description Table), which defines motherboard peripherals and power management routines.

Dumping raw binary DSDT tables using acpidump

Decompile the raw ACPI Machine Language bytecode (.dat) into human-readable ACPI Source Language (.dsl) using the ACPICA compiler.

Decompiling AML bytecode to ASL source with iasl

Review the generated disassembly file on disk to verify that conversion completed without corruption and note its overall footprint.

Checking disk usage of the generated dsdt.dsl file

Inspect the top metadata records in the disassembled source to extract critical hardware identifiers, OEM designations, compilation timestamps, and revision standards.

Examining OEM headers and table metadata within the disassembled DSDT

This workflow outlines the core lifecycle of tracking ACPI firmware events, interfacing directly with runtime kernel debug interfaces via acpidbg, and correlating bytecode routines against disassembled system tables on Ubuntu platforms.