1 .\" $NetBSD: amldb.8,v 1.3 2008/02/26 04:50:02 lukem Exp $
2 .\" ACPI (ACPI Package)
4 .\" Copyright (c) 2000 Takanori Watanabe <takawata@FreeBSD.org>
5 .\" Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org>
6 .\" Copyright (c) 2000 Yasuo YOKOYAMA <yokoyama@jp.FreeBSD.org>
7 .\" Copyright (c) 2000 Norihiro KUMAGAI <kumagai@home.com>
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" $FreeBSD: src/usr.sbin/acpi/amldb/amldb.8,v 1.10 2002/08/13 16:07:26 ru Exp $
37 .Nd executing and debugging AML interpreter
46 utility parses the DSDT
47 (Differentiated System Description Table)
48 files, which usually are acquired from ACPI BIOS, and executes
49 the sequence of ACPI Control Methods described in AML
50 (ACPI Machine Language)
51 with its AML interpreter.
54 utility also has a simple ACPI virtual machine.
55 During execution of the
56 Control Methods each access to the region, such as
57 SystemMemory, SystemIO, PCI_Config, does not affect the real
58 hardware but only the virtual machine.
59 Because the sequence of virtual accesses is maintained in user space,
60 AML interpreter developers need not worry about any effect on hardware
61 when they analyze DSDT data files.
62 They can develop and debug the
63 interpreter, even if the machine has no ACPI BIOS.
65 The developer will need to acquire a DSDT data file from any machine
66 with ACPI BIOS through
68 The DSDT is a table, a part of the whole ACPI memory table
69 located in somewhere in the BIOS area
70 .Pq Li 0xa0000 \- 0x100000 .
71 It includes such information as the detailed hardware information
72 for PnP, and the set of procedures which perform power management from
74 The information is stored in AML format.
76 The AML interpreter can execute any of the Control Methods specified
78 When executed, it interprets the byte sequence in the
79 Control Method of DSDT, and disassembles the opcodes that it
81 (ACPI Source Language)
82 format to be displayed.
84 If it encounters one of more accesses to the region such as
85 SystemMemory in executing the Control Methods, its ACPI Virtual
86 Machine simulates the input/output operations to the resources in the
88 In writing to a certain region, the ACPI Virtual Machine
89 prepares a piece of memory corresponding to its address,
90 if necessary, and holds the specified value in the memory as the
92 In reading from a certain region, it fetches the value in the memory
93 .Pq Em region contents ,
94 prompts with it as the following:
95 .Bd -literal -offset indent
96 DEBUG[read(0, 0x100b6813)\*[Am]mask:0x1](default: 0x1 / 1) \*[Gt]\*[Gt]
99 for users to have the opportunity to modify it, and hands it to
101 In case that there is no corresponding region
102 in the AML Virtual Machine, the value zero is handed.
104 The interpreter continues to maintain all of the
109 You can specify their initial values with the file
111 in the current directory.
112 If it is executed with
114 option, it dumps the final status of all of its
119 Each line of there files consists of the following
120 fields, separated by tabs; region type, address, and value.
121 Region types are specified as follows;
122 .Bl -tag -width "Value" -compact -offset indent
137 Interactive commands are described below:
138 .Bl -tag -width indent
141 Performs single-step execution of the current Control Method.
142 If the next instruction is an invocation of another Control Method,
143 the step execution will continue in the following Control Method.
146 Performs single-step execution of the current Control Method.
147 Even if the next instruction is an invocation of another Control
148 Method, the step execution will not continue.
150 .Em Continue program being debugged :
151 Resumes execution of the AML interpreter.
154 has no way of breakpoint, this command might not so much useful.
156 .Em Quit method execution :
157 Terminates execution of the current Control Method.
160 is not in execution, this command causes to input the next
162 If there are no next DSDT data files, it terminates
166 .Em Show local name space tree and variables :
167 Displays the structure of the ACPI namespace tree.
170 is in execution, this command displays the structure that relates
171 to the objects, arguments, and local variables below the scope of the
172 current Control Method.
174 .Em Toggle region input prompt :
175 Switches whether the prompt for modifying the value read from the
180 .Em Toggle region output prompt :
181 Switches whether the prompt for modifying the value to be written
182 to the region contents will be shown or not.
185 .Em Show memory management statistics :
186 Displays the current statistics of the memory management system
187 on the AML interpreter.
189 .Em Run specified method :
190 Executes the specified Control Method.
191 If it requires one or
192 more arguments, a prompt such as the following appears;
194 Method: Arg 1 From 0x280626ce To 0x28062775
195 Enter argument values (ex. number 1 / string foo). 'q' to quit.
199 For each argument, a pair of type string and value delimited by
200 one or more spaces can be entered.
205 can be specified as the type string.
206 In the current implementation, only the first character of the type
212 For example, we can enter as follows:
218 .Em Find named objects from namespace :
219 Lists the named objects that includes the specified string as the
220 terminate elements searching from the ACPI namespace.
221 For the namespace is expressed as the sequence of four-character
222 elements, appropriate number of additional underscore
224 characters are necessary for specifying objects which have less than four
226 Unless additional underscores specified, matching
227 occurs as the beginning of word with the specified number of characters.
229 .Em Show help messsage :
230 Displays the command summary of
234 Exactly one of the following options must be specified.
237 shows its usage and terminates.
238 .Bl -tag -width indent
240 Dump the final status of all of the
242 in the ACPI Virtual Machine to the file
245 Terminate with the usage of this command.
247 Display the statistics of the memory management system on the
252 Display the tree structure of ACPI namespace after the
253 DSDT data file is read.
256 .Bl -tag -width region.ini -compact
261 The following is an example including, invoking the
265 (Possible Resource Settings)
266 objects, and executing the
269 Control Method by the AML interpreter.
270 .Bd -literal -offset indent
272 Loading p2b.dsdt.dat...done
274 \\_SB_.PCI0.ISA_.PS2M._PRS.
275 \\_SB_.PCI0.ISA_.IRDA._PRS.
276 \\_SB_.PCI0.ISA_.UAR2._PRS.
277 \\_SB_.PCI0.ISA_.UAR1._PRS.
278 \\_SB_.PCI0.ISA_.ECP_._PRS.
279 \\_SB_.PCI0.ISA_.LPT_._PRS.
280 \\_SB_.PCI0.ISA_.FDC0._PRS.
286 Method: Arg 1 From 0x2805f0a3 To 0x2805f0db
287 Enter argument values (ex. number 1 / string foo). 'q' to quit.
289 ==== Running _PTS. ====
292 If(LNot(LEqual(Arg0, 0x5)))
294 If(LEqual(Arg0, 0x1))
296 If(LEqual(Arg0, 0x2))
299 [aml_region_write(1, 1, 0x1, 0xe42c, 0x18, 0x1)]
300 amldb: region.ini: No such file or directory
301 [1:0x00@0xe42f]-\*[Gt][1:0x01@0xe42f]
302 [write(1, 0x1, 0xe42f)]
303 [aml_region_read(1, 1, 0xe42c, 0x18, 0x1)]
305 DEBUG[read(1, 0xe42f)\*[Am]mask:0x1](default: 0x1 / 1) \*[Gt]\*[Gt]
306 [read(1, 0xe42f)-\*[Gt]0x1]
308 Or(Arg0, 0xf0, Local2)[Copy number 0xf5]
310 _PTS Method: Arg 1 From 0x2805f0a3 To 0x2805f0db
315 [aml_region_write(1, 1, 0xf5, 0x80, 0x0, 0x8)]
316 [1:0x00@0x80]-\*[Gt][1:0xf5@0x80]
317 [write(1, 0xf5, 0x80)]
318 [aml_region_read(1, 1, 0x80, 0x0, 0x8)]
320 DEBUG[read(1, 0x80)\*[Am]mask:0xf5](default: 0xf5 / 245) \*[Gt]\*[Gt]
321 [read(1, 0x80)-\*[Gt]0xf5]
324 _PTS Method: Arg 1 From 0x2805f0a3 To 0x2805f0db
326 ==== _PTS finished. ====
340 .An Takanori Watanabe Aq takawata@FreeBSD.org
341 .An Mitsuru IWASAKI Aq iwasaki@FreeBSD.org
342 .An Yasuo YOKOYAMA Aq yokoyama@jp.FreeBSD.org
344 Some contributions made by
345 .An Chitoshi Ohsawa Aq ohsawa@catv1.ccn-net.ne.jp ,
346 .An Takayasu IWANASHI Aq takayasu@wendy.a.perfect-liberty.or.jp ,
347 .An Norihiro KUMAGAI Aq kumagai@home.com ,
348 .An Kenneth Ingham Aq ingham@I-pi.com ,
350 .An Michael Lucas Aq mwlucas@blackhelicopters.org .
352 The ACPI virtual machine does not completely simulate the behavior
353 of a machine with an ACPI BIOS.
354 In the current implementation, the
355 ACPI virtual machine only reads or writes the stored values by
356 emulating access to regions such as SystemMemory.
358 Because the AML interpreter interprets and disassembles
359 simultaneously, it is impossible to implement such features as setting
360 breakpoints with the specified line number in ASL.
362 at certain Control Methods, which is not very difficult, has not
363 yet implemented because nobody has ever needed it.