AMLDB(8) BSD System Manager's Manual AMLDB(8)
NAME
amldb -- executing and debugging AML interpreter (with DSDT files)
SYNOPSIS
amldb [-dhst] dsdt_file ...
DESCRIPTION
The amldb utility parses the DSDT (Differentiated System Description Table) files, which usually are acquired from ACPI BIOS, and executes
the sequence of ACPI Control Methods described in AML (ACPI Machine Language) with its AML interpreter. The amldb utility also has a simple
ACPI virtual machine. During execution of the Control Methods each access to the region, such as SystemMemory, SystemIO, PCI_Config, does
not affect the real hardware but only the virtual machine. Because the sequence of virtual accesses is maintained in user space, AML inter-
preter developers need not worry about any effect on hardware when they analyze DSDT data files. They can develop and debug the interpreter,
even if the machine has no ACPI BIOS.
The developer will need to acquire a DSDT data file from any machine with ACPI BIOS through acpidump(8). The DSDT is a table, a part of the
whole ACPI memory table located in somewhere in the BIOS area (0xa0000 - 0x100000). It includes such information as the detailed hardware
information for PnP, and the set of procedures which perform power management from the OS. The information is stored in AML format.
The AML interpreter can execute any of the Control Methods specified by users. When executed, it interprets the byte sequence in the Control
Method of DSDT, and disassembles the opcodes that it recognizes into ASL (ACPI Source Language) format to be displayed.
If it encounters one of more accesses to the region such as SystemMemory in executing the Control Methods, its ACPI Virtual Machine simulates
the input/output operations to the resources in the region. In writing to a certain region, the ACPI Virtual Machine prepares a piece of
memory corresponding to its address, if necessary, and holds the specified value in the memory as the region contents. In reading from a
certain region, it fetches the value in the memory (region contents), prompts with it as the following:
DEBUG[read(0, 0x100b6813)&mask:0x1](default: 0x1 / 1) >>
for users to have the opportunity to modify it, and hands it to the AML interpreter. In case that there is no corresponding region in the
AML Virtual Machine, the value zero is handed.
The interpreter continues to maintain all of the region contents until amldb terminates. You can specify their initial values with the file
region.ini in the current directory. If it is executed with -d option, it dumps the final status of all of its region contents to the file
region.dmp when it terminates. Each line of there files consists of the following fields, separated by tabs; region type, address, and
value. Region types are specified as follows;
Value Region type
0 SystemMemory
1 SystemIO
2 PCI_Config
3 EmbeddedControl
4 SMBus
Interactive commands are described below:
s Single step: Performs single-step execution of the current Control Method. If the next instruction is an invocation of another Con-
trol Method, the step execution will continue in the following Control Method.
n Step program: Performs single-step execution of the current Control Method. Even if the next instruction is an invocation of another
Control Method, the step execution will not continue.
c Continue program being debugged: Resumes execution of the AML interpreter. Because the current amldb has no way of breakpoint, this
command might not so much useful.
q Quit method execution: Terminates execution of the current Control Method. If amldb is not in execution, this command causes to
input the next DSDT data file. If there are no next DSDT data files, it terminates amldb itself.
t Show local name space tree and variables: Displays the structure of the ACPI namespace tree. If amldb is in execution, this command
displays the structure that relates to the objects, arguments, and local variables below the scope of the current Control Method.
i Toggle region input prompt: Switches whether the prompt for modifying the value read from the region contents be showed or not.
Default is On.
o Toggle region output prompt: Switches whether the prompt for modifying the value to be written to the region contents will be shown
or not. The default is Off.
m Show memory management statistics: Displays the current statistics of the memory management system on the AML interpreter.
r method
Run specified method: Executes the specified Control Method. If it requires one or more arguments, a prompt such as the following
appears;
Method: Arg 1 From 0x280626ce To 0x28062775
Enter argument values (ex. number 1 / string foo). 'q' to quit.
Arg0 ?
For each argument, a pair of type string and value delimited by one or more spaces can be entered. Now only number and string can be
specified as the type string. In the current implementation, only the first character of the type string, such as n or s, is identi-
fied. For example, we can enter as follows:
Arg0 ? n 1
f string
Find named objects from namespace: Lists the named objects that includes the specified string as the terminate elements searching
from the ACPI namespace. For the namespace is expressed as the sequence of four-character elements, appropriate number of additional
underscore ('_') characters are necessary for specifying objects which have less than four character string. Unless additional
underscores specified, matching occurs as the beginning of word with the specified number of characters.
h Show help messsage: Displays the command summary of amldb.
OPTIONS
Exactly one of the following options must be specified. Otherwise, amldb shows its usage and terminates.
-d Dump the final status of all of the region contents in the ACPI Virtual Machine to the file region.dmp.
-h Terminate with the usage of this command.
-s Display the statistics of the memory management system on the AML interpreter when amldb terminates.
-t Display the tree structure of ACPI namespace after the DSDT data file is read.
FILES
region.ini
region.dmp
EXAMPLES
The following is an example including, invoking the amldb, searching _PRS (Possible Resource Settings) objects, and executing the _PTS (Pre-
pare To Sleep) Control Method by the AML interpreter.
% amldb p2b.dsdt.dat
Loading p2b.dsdt.dat...done
AML>f _PRS
\_SB_.PCI0.ISA_.PS2M._PRS.
\_SB_.PCI0.ISA_.IRDA._PRS.
\_SB_.PCI0.ISA_.UAR2._PRS.
\_SB_.PCI0.ISA_.UAR1._PRS.
\_SB_.PCI0.ISA_.ECP_._PRS.
\_SB_.PCI0.ISA_.LPT_._PRS.
\_SB_.PCI0.ISA_.FDC0._PRS.
\_SB_.LNKD._PRS.
\_SB_.LNKC._PRS.
\_SB_.LNKB._PRS.
\_SB_.LNKA._PRS.
AML>r _PTS
Method: Arg 1 From 0x2805f0a3 To 0x2805f0db
Enter argument values (ex. number 1 / string foo). 'q' to quit.
Arg0 ? n 5
==== Running _PTS. ====
AML>s
[\_PTS. START]
If(LNot(LEqual(Arg0, 0x5)))
AML>
If(LEqual(Arg0, 0x1))
AML>
If(LEqual(Arg0, 0x2))
AML>
Store(One, TO12)
[aml_region_write(1, 1, 0x1, 0xe42c, 0x18, 0x1)]
amldb: region.ini: No such file or directory
[1:0x00@0xe42f]->[1:0x01@0xe42f]
[write(1, 0x1, 0xe42f)]
[aml_region_read(1, 1, 0xe42c, 0x18, 0x1)]
[1:0x01@0xe42f]
DEBUG[read(1, 0xe42f)&mask:0x1](default: 0x1 / 1) >>
[read(1, 0xe42f)->0x1]
AML>
Or(Arg0, 0xf0, Local2)[Copy number 0xf5]
AML>t
_PTS Method: Arg 1 From 0x2805f0a3 To 0x2805f0db
Arg0 Num:0x5
Local2 Num:0xf5
AML>s
Store(Local2, DBG1)
[aml_region_write(1, 1, 0xf5, 0x80, 0x0, 0x8)]
[1:0x00@0x80]->[1:0xf5@0x80]
[write(1, 0xf5, 0x80)]
[aml_region_read(1, 1, 0x80, 0x0, 0x8)]
[1:0xf5@0x80]
DEBUG[read(1, 0x80)&mask:0xf5](default: 0xf5 / 245) >>
[read(1, 0x80)->0xf5]
AML>
[\_PTS. END]
_PTS Method: Arg 1 From 0x2805f0a3 To 0x2805f0db
NO object
==== _PTS finished. ====
AML>q
%
SEE ALSO
acpi(4), acpidump(8)
HISTORY
The amldb utility appeared in FreeBSD 5.0.
AUTHORS
Takanori Watanabe <takawata@FreeBSD.org>
Mitsuru IWASAKI <iwasaki@FreeBSD.org>
Yasuo YOKOYAMA <yokoyama@jp.FreeBSD.org>
Some contributions made by
Chitoshi Ohsawa <ohsawa@catv1.ccn-net.ne.jp>,
Takayasu IWANASHI <takayasu@wendy.a.perfect-liberty.or.jp>,
Norihiro KUMAGAI <kumagai@home.com>,
Kenneth Ingham <ingham@I-pi.com>, and
Michael Lucas <mwlucas@blackhelicopters.org>.
BUGS
The ACPI virtual machine does not completely simulate the behavior of a machine with an ACPI BIOS. In the current implementation, the ACPI
virtual machine only reads or writes the stored values by emulating access to regions such as SystemMemory.
Because the AML interpreter interprets and disassembles simultaneously, it is impossible to implement such features as setting breakpoints
with the specified line number in ASL. Setting breakpoints at certain Control Methods, which is not very difficult, has not yet implemented
because nobody has ever needed it.
BSD
August 31, 2000 BSD