Check out my first novel, midnight's simulacra!

ACPI: Difference between revisions

From dankwiki
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
Not to be confused with [[APIC]].
Not to be confused with [[APIC]]. The second worst type of coder in the world is the kind that [http://geekz.co.uk/lovesraymond/archive/so-i-married-a-kernel-programmer shows up with a bloody shovel]. The worst kind is a [http://dankamongmen.livejournal.com/#entry_298962 BIOS coder]. Upwards and onwards to ACPI, a creation of the [http://www.acpi.info/ Advanced Configuration and Power Interface] group.


The second worst type of coder in the world is the kind that [http://geekz.co.uk/lovesraymond/archive/so-i-married-a-kernel-programmer shows up with a bloody shovel]. The worst kind is a BIOS coder. This tradition has been proudly maintained by a Purple Sash Society of BIOS programmers ("enumerators", "scribes", whatever), primarily illiterate folk from Alberta and [http://dankamongmen.livejournal.com/#entry_298962 Thailand]. Anyway, on to ACPI, a creation of the [http://www.acpi.info/ Advanced Configuration and Power Interface] group.
==Specifications==
 
As of September 2019, the current version of ACPI is Revision 6.3, published January 2019. It is now published as part of the [[UEFI]] standards, and administered by the UEFI Forum.
==DSDT==
* [https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf ACPI 6.3] specification
Differentiated System Description Tables.
<pre>
[recombinator](0) $ sudo acpidump -t DSDT -b -o acpidump.dsdt
[recombinator](0) $ iasl -d acpidump.dsdt
 
Intel ACPI Component Architecture
AML Disassembler version 20061109 [Mar 19 2009]
Copyright (C) 2000 - 2006 Intel Corporation
Supports ACPI Specification Revision 3.0a
 
Loading Acpi table from file acpidump.dsdt
Acpi table [DSDT] successfully installed and loaded
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
..................................................... etc
Parsing completed
Disassembly completed, written to "acpidump.dsl"
[recombinator](0) $ </pre>
===Rebuilding a decompiled DSDT===
<pre>[recombinator](0) $ iasl -tc acpidump.dsl
 
Intel ACPI Component Architecture
ASL Optimizing Compiler version 20061109 [Mar 19 2009]
Copyright (C) 2000 - 2006 Intel Corporation
Supports ACPI Specification Revision 3.0a
 
acpidump.dsl  2186:                    Acquire (MUT0, 0x0FFF)
Warning  1103 -        Possible operator timeout is ignored ^
 
ASL Input:  acpidump.dsl - 5185 lines, 178349 bytes, 1615 keywords
AML Output: acpidump.aml - 15771 bytes 546 named objects 1069 executable opcodes
 
Compilation complete. 0 Errors, 1 Warnings, 0 Remarks, 597 Optimizations
[recombinator](0) $ </pre>


==acpidump/acpixtract==
==acpidump/acpixtract==
Line 87: Line 52:
[recombinator](0) $</pre>
[recombinator](0) $</pre>


==Specifications==
==DSDT==
The current version is 3.0, amended as 3.0a. Version 4.0 is under development.
Differentiated System Description Tables.
* [http://www.acpi.info/spec30a.htm ACPI 3.0a] specification
<pre>
* [http://www.acpi.info/spec30.htm ACPI 3.0] specification
[recombinator](0) $ sudo acpidump -t DSDT -b -o acpidump.dsdt
[recombinator](0) $ iasl -d acpidump.dsdt
 
Intel ACPI Component Architecture
AML Disassembler version 20061109 [Mar 19 2009]
Copyright (C) 2000 - 2006 Intel Corporation
Supports ACPI Specification Revision 3.0a
 
Loading Acpi table from file acpidump.dsdt
Acpi table [DSDT] successfully installed and loaded
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
..................................................... etc
Parsing completed
Disassembly completed, written to "acpidump.dsl"
[recombinator](0) $ </pre>
===Rebuilding a decompiled DSDT===
<pre>[recombinator](0) $ iasl -tc acpidump.dsl
 
Intel ACPI Component Architecture
ASL Optimizing Compiler version 20061109 [Mar 19 2009]
Copyright (C) 2000 - 2006 Intel Corporation
Supports ACPI Specification Revision 3.0a
 
acpidump.dsl  2186:                    Acquire (MUT0, 0x0FFF)
Warning  1103 -        Possible operator timeout is ignored ^
 
ASL Input:  acpidump.dsl - 5185 lines, 178349 bytes, 1615 keywords
AML Output: acpidump.aml - 15771 bytes 546 named objects 1069 executable opcodes
 
Compilation complete. 0 Errors, 1 Warnings, 0 Remarks, 597 Optimizations
[recombinator](0) $ </pre>
 
==SRAT==
[http://lwn.net/Articles/7177/ Linux in 2009] gained support for parsing of the BIOS-provided SRAT table ([http://mail-index.netbsd.org/port-amd64/2009/11/23/msg001026.html NetBSD also had support] by later that year). The SRAT describes memory and processor topology, and the hot-pluggable status of all.
* Use the CONFIG_X86_64_ACPI_NUMA kernel option to enable SRAT-based enumeration of [[NUMA]].


==See also==
==See also==
Line 96: Line 97:
* Legacy info regarding [http://acpi.sourceforge.net/dsdt/index.php Linux DSDT] replacement
* Legacy info regarding [http://acpi.sourceforge.net/dsdt/index.php Linux DSDT] replacement
* Intel's [http://www.intel.com/technology/IAPC/acpi/ ACPI] page, including <tt>iasl</tt>.
* Intel's [http://www.intel.com/technology/IAPC/acpi/ ACPI] page, including <tt>iasl</tt>.
* The MADT table can be used to discover [[SMP on x86|SMP]] topology
[[Category: x86]]

Latest revision as of 13:52, 17 September 2019

Not to be confused with APIC. The second worst type of coder in the world is the kind that shows up with a bloody shovel. The worst kind is a BIOS coder. Upwards and onwards to ACPI, a creation of the Advanced Configuration and Power Interface group.

Specifications

As of September 2019, the current version of ACPI is Revision 6.3, published January 2019. It is now published as part of the UEFI standards, and administered by the UEFI Forum.

acpidump/acpixtract

acpidump differs subtly and annoyingly between Debian and FreeBSD.

[recombinator](0) $ sudo acpidump  -o recombinator.acpi 
[recombinator](0) $  acpixtract -l recombinator.acpi 

Signature Length  OemId     OemTableId   OemRevision CompilerId CompilerRevision

    DSDT   17452  "INTEL "  "DG965WH "    000006C1    "MSFT"     01000013
    FACS      64
    FACP     116  "INTEL "  "DG965WH "    000006C1    "MSFT"     01000013
    APIC     120  "INTEL "  "DG965WH "    000006C1    "MSFT"     01000013
    WDDT      64  "INTEL "  "DG965WH "    000006C1    "MSFT"     01000013
    MCFG      60  "INTEL "  "DG965WH "    000006C1    "MSFT"     01000013
    ASF!     166  "INTEL "  "DG965WH "    000006C1    "MSFT"     01000013
    HPET      56  "INTEL "  "DG965WH "    000006C1    "MSFT"     01000013
    SSDT     524  "INTEL "  "CpuPm   "    000006C1    "MSFT"     01000013
    SSDT     373  "INTEL "  "Cpu0Ist "    000006C1    "MSFT"     01000013
    SSDT     373  "INTEL "  "Cpu1Ist "    000006C1    "MSFT"     01000013
    SSDT     373  "INTEL "  "Cpu2Ist "    000006C1    "MSFT"     01000013
    SSDT     373  "INTEL "  "Cpu3Ist "    000006C1    "MSFT"     01000013
    RSDT      80  "INTEL "  "DG965WH "    000006C1    "    "     01000013
    RSDP          "INTEL "

Found 15 ACPI tables [20060324]
[recombinator](0) $  acpixtract recombinator.acpi 
Acpi table [DSDT] - 17452 bytes written to DSDT.dat
Acpi table [SSDT] - 524 bytes written to SSDT1.dat
Acpi table [SSDT] - 373 bytes written to SSDT2.dat
Acpi table [SSDT] - 373 bytes written to SSDT3.dat
Acpi table [SSDT] - 373 bytes written to SSDT4.dat
Acpi table [SSDT] - 373 bytes written to SSDT5.dat
[recombinator](0) $ iasl -d DSDT.dat

Intel ACPI Component Architecture
AML Disassembler version 20061109 [May 15 2007]
Copyright (C) 2000 - 2006 Intel Corporation
Supports ACPI Specification Revision 3.0a

Loading Acpi table from file DSDT.dat
Acpi table [DSDT] successfully installed and loaded
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
Parsing completed
Disassembly completed, written to "DSDT.dsl"
[recombinator](0) $

DSDT

Differentiated System Description Tables.

[recombinator](0) $ sudo acpidump -t DSDT -b -o acpidump.dsdt
[recombinator](0) $ iasl -d acpidump.dsdt 

Intel ACPI Component Architecture
AML Disassembler version 20061109 [Mar 19 2009]
Copyright (C) 2000 - 2006 Intel Corporation
Supports ACPI Specification Revision 3.0a

Loading Acpi table from file acpidump.dsdt
Acpi table [DSDT] successfully installed and loaded
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
..................................................... etc
Parsing completed
Disassembly completed, written to "acpidump.dsl"
[recombinator](0) $ 

Rebuilding a decompiled DSDT

[recombinator](0) $ iasl -tc acpidump.dsl 

Intel ACPI Component Architecture
ASL Optimizing Compiler version 20061109 [Mar 19 2009]
Copyright (C) 2000 - 2006 Intel Corporation
Supports ACPI Specification Revision 3.0a

acpidump.dsl  2186:                     Acquire (MUT0, 0x0FFF)
Warning  1103 -        Possible operator timeout is ignored ^ 

ASL Input:  acpidump.dsl - 5185 lines, 178349 bytes, 1615 keywords
AML Output: acpidump.aml - 15771 bytes 546 named objects 1069 executable opcodes

Compilation complete. 0 Errors, 1 Warnings, 0 Remarks, 597 Optimizations
[recombinator](0) $ 

SRAT

Linux in 2009 gained support for parsing of the BIOS-provided SRAT table (NetBSD also had support by later that year). The SRAT describes memory and processor topology, and the hot-pluggable status of all.

  • Use the CONFIG_X86_64_ACPI_NUMA kernel option to enable SRAT-based enumeration of NUMA.

See also