---
title: ACPI AML Runtime Debugger in Ubuntu 18.04 (x64)
description: The aml-debugger.txt is the instruction for enabling AML run-time debugger.
  This document is available at Documentation/acpi/ in Linux kernel source code.
url: https://canonical.com/blog/acpi-aml-runtime-debugger-in-ubuntu-18-04-x64?format=md
---

1. [Blog](https://canonical.com/blog)
2. Article

---

[Alex Hung](https://canonical.com/blog/author/alexhung "More about Alex Hung")

14 February 2019

# ACPI AML Runtime Debugger in Ubuntu 18.04 (x64)

[ACPI](https://canonical.com/blog/tag/acpi)
[Debugging](https://canonical.com/blog/tag/debugging)
[Ubuntu Desktop](https://canonical.com/blog/tag/ubuntu-desktop)

---

Share the article

[ACPICA](https://www.acpica.org/) is an open-source project that provides an operating system (OS)-independent reference implementation. It also contains a list of utilities such as ASL compiler (iasl), acpiexec (an AML emulator). However, AML debugging on Linux in run-time wasn’t provided in ACPICA until Linux Kernel 4.13.

## Enabling AML Debugging

The [aml-debugger.txt](https://github.com/torvalds/linux/blob/master/Documentation/acpi/aml-debugger.txt) is the instruction for enabling AML run-time debugger. This document is available at Documentation/acpi/ in Linux kernel source code. In short, two things are required for AML run-time debugging

* Enable AML debugging (**CONFIG\_ACPI\_DEBUGGER**=y & **CONFIG\_ACPI\_DEBUGGER\_USER**=m) when compiling Linux kernel
* Compile an utility, **acpidbg** from Linux kernel (I uploaded a copy [here](http://people.canonical.com/~alexhung/acpidbg))

While compiling a custom-build kernel is nothing new to kernel developers, it is often inconvenient for system firmware / BIOS developers. Fortunately, Ubuntu 18.04 (x64) and later enable these config by default. One can simply execute ***acpidbg*** on Ubuntu 18.04 – even on Ubuntu Live from USB too!

Note: acpidbg can be installed by the following command on Ubuntu

```
sudo apt install linux-tools-`uname -r` linux-tools-generic
```

## Running AML Debugging

Executing acpidbg on Ubuntu 18.04 (x64) is straight-forward

```
$ sudo ./acpidbg
-
```

and “help” shows a list supported commands

```
- help

General-Purpose Commands:
 ...
 ...
Namespace Access Commands:
 ...
 ...
Control Method Execution Commands:
 ...
 ...
```

## Examples

***acpidbg*** is particularly handy when one needs to evaluate any ACPI AML objects during run-time – especially ones that change under different conditions. This may be explained by some examples below:

**Example 1** – To determine AC power status in run-time.

1. Find \_PSR objects
2. Evaluate \_PSR when AC is disconnected
3. Evaluate \_PSR when AC is connected

```
- find _PSR
        \_SB.PCI0.LPC.EC.AC._PSR Method       00000000c53d0a47 01 Args 0 Len 0023 Aml 00000000eab88cb2

- execute \_SB.PCI0.LPC.EC.AC._PSR
Evaluating \_SB.PCI0.LPC.EC.AC._PSR
Evaluation of \_SB.PCI0.LPC.EC.AC._PSR returned object 00000000c46fa555, external buffer length 18
 [Integer] = 0000000000000000

- execute \_SB.PCI0.LPC.EC.AC._PSR
Evaluating \_SB.PCI0.LPC.EC.AC._PSR
Evaluation of \_SB.PCI0.LPC.EC.AC._PSR returned object 00000000c46fa555, external buffer length 18
 [Integer] = 0000000000000001
```

***acpidbg*** also works with complex objects such as packages.

**Example 2** – To determine battery information and status

1. Find \_BIF and \_BST objects
2. Evaluate \_BIF and \_BST objects (note \_BST changes dynamically).

```
- find _BIF
      \_SB.PCI0.LPC.EC.BAT0._BIF Method       00000000817541c3 01 Args 0 Len 0040 Aml 000000009abb252e

- execute \_SB.PCI0.LPC.EC.BAT0._BIF
Evaluating \_SB.PCI0.LPC.EC.BAT0._BIF
Evaluation of \_SB.PCI0.LPC.EC.BAT0._BIF returned object 00000000c46fa555, external buffer length 170
 [Package] Contains 13 Elements:
  [Integer] = 0000000000000000
  [Integer] = 000000000000ABE0
  [Integer] = 0000000000009E34
  [Integer] = 0000000000000001
  [Integer] = 0000000000003B60
  [Integer] = 00000000000007E9
  [Integer] = 00000000000000C8
  [Integer] = 0000000000000001
  [Integer] = 0000000000000001
  [String] Length 07 = "00HW027"
  [String] Length 05 = "  409"
  [String] Length 03 = "LiP"
  [String] Length 03 = "SMP"

- find _BST
      \_SB.PCI0.LPC.EC.BAT0._BST Method       00000000ed98c5ba 01 Args 0 Len 001D Aml 00000000a48eaeb6

- execute \_SB.PCI0.LPC.EC.BAT0._BST
Evaluating \_SB.PCI0.LPC.EC.BAT0._BST
Evaluation of \_SB.PCI0.LPC.EC.BAT0._BST returned object 00000000c46fa555, external buffer length 78
 [Package] Contains 4 Elements:
  [Integer] = 0000000000000001
  [Integer] = 00000000000010C6
  [Integer] = 00000000000088B8
  [Integer] = 0000000000003FC9
```

**acpidbg** can decode bit fields and save time on counting bits. Try
to run acpidbg to evaluate any \_PLD objects and you will see what I
mean :).

## Sign up for our newsletter

Get the latest Canonical news and updates in your inbox.

Work email:

\*I agree to receive information about Canonical's
products and services.

By submitting this form, I confirm that I have read and agree to [Canonical's Privacy Policy](https://canonical.com/legal/dataprivacy).

Sign up

## Share on

---

## Related posts

[### Arduino® VENTUNO™ Q is available for pre-order with Ubuntu pre-installed](https://canonical.com/blog/arduino-ventuno-q-is-available-for-pre-order-with-ubuntu-pre-installed)

London, UK – August 25, 2026 – Following our initial collaboration announcement in March 2026, Canonical and Arduino (a subsidiary of Qualcomm Technologies, Inc.) are excited...

[Canonical](https://canonical.com/blog/author/canonical)

25 August 2026

[### AI with AMD ROCm on Ubuntu: your questions answered](https://canonical.com/blog/amd-rocm-on-ubuntu)

AMD ROCm is now available in Ubuntu 26.04 LTS. Learn what how to make the best of it, and find out what this will mean in the coming years for development in Ubuntu.

[Kevin Cazabon](https://canonical.com/blog/author/kcazabon)

3 June 2026

[### Canonical releases Ubuntu 26.04 LTS Resolute Raccoon](https://canonical.com/blog/canonical-releases-ubuntu-26-04-lts-resolute-raccoon)

The 11th long-term supported release of Ubuntu delivers deep silicon optimization and state-of-the-art security for enterprise workloads.

[Canonical](https://canonical.com/blog/author/canonical)

23 April 2026

[### How to manage Ubuntu fleets using on-premises Active Directory and ADSys](https://canonical.com/blog/manage-ubuntu-fleets-active-directory)

The “hybrid fleet” is today’s reality: organizations diversify operating systems while Microsoft Active Directory (AD) remains the dominant identity “source of truth.” IT...

[Massimiliano Gori](https://canonical.com/blog/author/massigori)

31 March 2026
