The acpiexec tool is an AML emulator that allows one to execute and interactively ACPI AML code from your BIOS. The
tarball can be downloaded from the
ACPICA website and built as follows:
1. Unzip and untar the acica-unix-20100304.tar.gz tarball.
2. cd into tools/acpiexec
3. run make
This should build acpiexec. Now for the fun part - executing your ACPI inside the emulator. To do this grab your ACPI tables and extract them using:
sudo acpidump > acpi.info && acpixtract -a acpi.info
Now load these tables into the emulator and run with verbose mode:
./acpiexec -v *.dat
Inside the emulator you can type
help to navigate around the help system. It may take a little bit of work to get familiar with all the commands available.
As a quick introduction, here is how to execute the battery information
_BIF method.
1. Get a list of all the available methods, type:
methods
on my Lenovo laptop the battery information method is labelled
\_SB_.PCI0.LPCB.BAT1._BIF, so to execute this method I use:
execute \_SB_.PCI0.LPCB.BAT1._BIF
Executing \_SB_.PCI0.LPCB.BAT1._BIF
Execution of \_SB_.PCI0.LPCB.BAT1._BIF returned object 0x19669d0 Buflen 178
[Package] Contains 13 Elements:
[Integer] = 0000000000000001
[Integer] = 0000000000000FA0
[Integer] = 0000000000000FA0
[Integer] = 0000000000000001
[Integer] = 0000000000002B5C
[Integer] = 00000000000001A4
[Integer] = 000000000000009C
[Integer] = 0000000000000108
[Integer] = 0000000000000EC4
[String] Length 08 = PA3465U
[String] Length 05 = 3658Q
[String] Length 06 = Li-Ion
[String] Length 07 = COMPAL
So far so good. I single stepped through the code using the debug command on the method as follows:
debug \_SB_.PCI0.LPCB.BAT1._BIF
at each % prompt, one can press enter to step the next instruction. If the method requires arguments, these can be passed into the method by specifying them after the method name from the debug command.
To see any local variables used during execution, use the
locals command. The
list command lists the current AML instructions. The
set commands allows one to set method data and interact with the debugging processes.
Hopefully this gives one a taste of what the emulator can do. The internal help is enough to get one up and running, and one does generally require the current
ACPI specification to figure out what's happening in your ACPI tables.