---
title: Analyze ACPI Tables in a Text File with FWTS
description: FWTS can use acpidump as an input for ACPI tests. This tutorial shows
  how to read acpidump in fwts and how to build customized one from scratches.
url: https://canonical.com/blog/analyze-acpi-tables-in-a-text-file-with-fwts?format=md
---

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

---

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

8 July 2019

# Analyze ACPI Tables in a Text File with FWTS

[ACPI](https://canonical.com/blog/tag/acpi)
[Development](https://canonical.com/blog/tag/development)
[Firmware](https://canonical.com/blog/tag/firmware)
[FWTS](https://canonical.com/blog/tag/fwts)
[kernel](https://canonical.com/blog/tag/kernel)

---

Share the article

I often need to implement tests for new ACPI tables before they become available on real hardware. Fortunately, FWTS provides a framework to read ACPI tables’ binary.

The below technique is especially convenient for ACPI firmware and OS kernel developers. It provides a simple approach to verifying ACPI tables without compiling firmware and deploying it to hardware.

## Using acpidump.log as an input for FWTS

The command to read ACPI tables’ binary is

```
# check ACPI methods in a text file
$ fwts method --dumpfile=acpidump.log
```

or

```
# check ACPI FACP table in a text file
$ fwts facp --dumpfile=acpidump.log
```

where *acpidump.log* contains ACPI tables’ binary in a specific format as depicted below:

* Table Signature – the 4-byte long ACPI table signature
* Offset – data starts from 0000 and increases by 16 bytes per line
* Hex Data- each line has 16 hex integers of the compiled ACPI table
* ASCII Data – the ASCII presentation of the hex data

This format may look familiar because it is not specific to FWTS. In fact, it is the same format generated by [acpidump](https://admin.insights.ubuntu.com/2019/03/20/debug-dsdt-ssdt-with-acpica-utilities/). In other words, the below two code snippets generate identical results.

```
# reading ACPI tables from memory
$ sudo fwts method
```

```
# dumping ACPI tables and testing it
$ sudo acpidump > acpidump.log
$ fwts method --dumpfile=acpidump.log
```

For developers, using *–dumpfile* option means that it is possible to test ACPI tables before deploying them on real hardware. The following sections present how to prepare a customized log file.

### Using a customized acpidump.log for FWTS

We can use [acpica-tools](https://admin.insights.ubuntu.com/2019/03/20/debug-dsdt-ssdt-with-acpica-utilities/) to generate an acpidump.log. The following is an example of building a customized acpidump.log to test the *fwts method* command.

#### **Generate a dummy FADT**

A Fixed ACPI Description Table (FADT) contains vital information to ACPI OS such as the base addresses for hardware registers. As a result, FWTS requires a FADT in an acpidump.log so it can recognize acpidump.log as a valid input file.

```
$ iasl -T FACP
$ iasl facp.asl > /dev/zero
$ echo "FACP @ 0x0000000000000000" >> acpidump.log
$ xxd -c 16 -g 1 facp.aml  | sed 's/^0000/    /' >> acpidump.log
$ echo "" >> acpidump.log
```

#### **Develop a Customized DSDT table**

A Differentiated System Description Table (DSDT) is designed to provide OEM’s value-added features. A dummy DSDT can be generated as below, and OEM value-added features, such as ACPI battery or hotkey for airplane mode, can be added to it.

```
# Generate a DSDT
$ iasl -T DSDT
# Customize dsdt.asl
#  ex. adding an ACPI battery or airplane mode devices
```

#### **Compile the DSDT table to binary**

The customized DSDT can be compiled and appended to *acpidump.log*.

```
$ iasl dsdt.asl > /dev/zero
$ echo "DSDT @ 0x0000000000000000" >> acpidump.log
$ xxd -c 16 -g 1 dsdt.aml  | sed 's/^0000/    /' >> acpidump.log
$ echo "" >> acpidump.log
```

#### **Run method test with acpidump.log**

And finally, run the fwts method test.

```
$ fwts method --dumpfile=acpidump.log
```

### Final Words

While we use DSDT as an example, the same technique applies to all ACPI tables. For instance, HMAT was introduced and frequently updated in recent ACPI specs, and the Firmware Test Suite includes most, if not all, changes up-to-date. As a consequence, FWTS is able to detect errors before firmware developers integrate HMAT into their projects, and therefore reduces errors in final products.

[Get in touch

Interested in running Ubuntu in your organization?](https://ubuntu.com/about/contact-us/form)

## 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

[### Mythbusting the scope of Livepatch protection](https://canonical.com/blog/mythbusting-the-scope-of-livepatch-protection)

The purpose of this article is to share the technical realities of security patching for the Linux kernel, and the intended scope of the Linux kernel’s livepatch capability....

[Rajan Patel](https://canonical.com/blog/author/rajanpatel927)

24 September 2025

[### Crafting new Linux schedulers with sched-ext, Rust and Ubuntu](https://canonical.com/blog/crafting-new-linux-schedulers-with-sched-ext-rust-and-ubuntu)

In our ongoing exploration of Rust and Ubuntu, we delve into an experimental kernel project that leverages these technologies to create new schedulers for Linux. Playing around...

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

26 February 2024

[### Ubuntu 22.04 FIPS 140-3 modules available for preview](https://canonical.com/blog/ubuntu-22-04-fips-140-3-modules-available-for-preview)

Canonical has been working with our testing lab partner, atsec information security, to prepare the cryptographic modules in Ubuntu 22.04 LTS (Jammy Jellyfish) for...

[Henry Coggill](https://canonical.com/blog/author/henrycoggill)

7 December 2023

[### Get familiar with “Rusty” kernel programming in Ubuntu Lunar Lobster](https://canonical.com/blog/get-familiar-with-rusty-kernel-programming-in-ubuntu-lunar-lobster)

The Linux kernel has recently introduced the Rust programming language as an alternative to C for creating kernel modules. Rust is a strongly, statically typed programming...

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

31 August 2023
