iT邦幫忙

2023 iThome 鐵人賽

DAY 3
0

ACPI SPEC 的 OSPM/ACPI Global System 這張圖描述了 ACPI/OSPM 裡軟體與硬體元件的關係,應用程式需透過 OS Kernal 與系統電源管理 (OSPM) 溝通、與裝置驅動溝通、與ACPI 驅動溝通,裝置驅動可控制底層硬體,而ACPI 驅動 (ACPI.sys) 可透過 BIOS 的 ACPI 資訊 (包括 ACPI 暫存器組、ACPI 靜態表、ACPI 韌體) 與底層硬體溝通。所以 ACPI 不是單純的軟體或韌體或硬體,而是一個完整的介面規格,橫跨軟體、韌體、硬體。

 OSPM ACPI Global System

這邊先提一下名詞後續會較好表達

縮寫 全名
RSDP Root System Description Pointer
RSDT Root System Description Table
XSDT Extended System Description Table

SPEC 的 Root System Description Pointer and Table中,簡易說明了ACPI Table的尋找過程,Root代表最上層,所以ACPI 由 RSDP 的 Signature “RSD PTR” 開始,結構內包含了兩個位址,其中之一對應的位址,Signature 為 XSDT,XSDT Table結構又包含了許多 ACPI Table 的 Entry Address,每個 Address 的 Table 都有各自的 Signature 與各自的 Structure。
Root System Description Pointer and Table

找 ACPI 最重要的就是如何尋找 RSDP,BIOS 開機過程會將 ROM 裡的 ACPI Data複製到 Memory 中,SPEC 中提到會在 1M 以下的空間中,通常是在0x000E0000 到 0x000FFFFF 之間,並使用特定的 Signature “RSD PTR”,找到 RSD PTR 就能以對應的 RSDP 結構解析資料,如搜尋不到就暴力搜尋 00000000h 到 FFFFFFFFh。RSDP中最重要的兩個資訊就是32bit 的RSDT Address 與 64bit 的 XSDT Address,兩者差異只在 BIT 位元數的不同,內容是一樣的。

RSDP Structure

Field Byte Length Byte Offset Description
Signature 8 0 "RSD PTR" (Notice that this signature must contain a trailing blank character.)
Checksum 1 8 This is the checksum of the fields defined in the ACPI 1.0 specification. This includes only the first 20 bytes of this table, bytes 0 to 19, including the checksum field. These bytes must sum to zero.
OEMID 6 9 An OEM-supplied string that identifies the OEM.
Revision 1 15 The revision of this structure. Larger revision numbers are backward compatible to lower revision numbers. The ACPI version 1.0 revision number of this table is zero. The ACPI version 1.0 RSDP Structure only includes the first 20 bytes of this table, bytes 0 to 19. It does not include the Length field and beyond. The current value for this field is 2.
RsdtAddress 4 16 32 bit physical address of the RSDT table.
Length 4 20 The length of the table, in bytes, including the header, starting from offset 0. This field is used to record the size of the entire table. This field is not available in the ACPI version 1.0 RSDP Structure.
XsdtAddress 8 24 64 bit physical address of the XSDT table.
Extended Checksum 1 32 This is a checksum of the entire table, including both checksum fields.
Reserved 3 33 Reserved field

RSDT Structure

Field Byte Length Byte Offset Description
Signature 4 0 "RSDT" Signature for the Root System Description Table.
Length 4 4 Length, in bytes, of the entire RSDT. The length implies the number of Entry fields (n) at the end of the table.
Revision 1 8 1
Checksum 1 9 Entire table must sum to zero.
OEMID 6 10 OEM ID
OEM Table ID 8 16 For the RSDT, the table ID is the manufacture model ID. This field must match the OEM Table ID in the FADT.
OEM Revision 4 24 OEM revision of RSDT table for supplied OEM Table ID.
Creator ID 4 28 Vendor ID of utility that created the table. For tables containing Definition Blocks, this is the ID for the ASL Compiler.
Creator Revision 4 32 Revision of utility that created the table. For tables containing Definition Blocks, this is the revision for the ASL Compiler.
Entry 4*n 36 An array of 32-bit physical addresses that point to other DESCRIPTION_HEADERs. OSPM assumes at least the DESCRIPTION_HEADER is addressable, and then can further address the table based upon its Length field.

XSDT Structure

Field Byte Length Byte Offset Description
Signature 4 0 "XSDT". Signature for the Extended System Description Table.
Length 4 4 Length, in bytes, of the entire table. The length implies the number of Entry fields (n) at the end of the table.
Revision 1 8 1
Checksum 1 9 Entire table must sum to zero.
OEMID 6 10 OEM ID
OEM Table ID 8 16 For the XSDT, the table ID is the manufacture model ID. This field must match the OEM Table ID in the FADT.
OEM Revision 4 24 OEM revision of XSDT table for supplied OEM Table ID.
Creator ID 4 28 Vendor ID of utility that created the table. For tables containing Definition Blocks, this is the ID for the ASL Compiler.
Creator Revision 4 32 Revision of utility that created the table. For tables containing Definition Blocks, this is the revision for the ASL Compiler.
Entry 8*n 36 An array of 64-bit physical addresses that point to other DESCRIPTION_HEADERs. OSPM assumes at least the DESCRIPTION_HEADER is addressable, and then can further address the table based upon its Length field.

RSDT 與 XSDT Structure 裡包含的許多 Entry,對應的 Signature 都有其獨特的涵義,簡略代表了Entry Table 裡的資料內容,詳細參考下列表格。

Signatures for tables defined by ACPI

Signature Description
APIC Multiple APIC Description Table
BERT Boot Error Record Table
BGRT Boot Graphics Resource Table
CCEL Virtual Firmware Confidential Computing Event Log Table.
CPEP Corrected Platform Error Polling Table
DSDT Differentiated System Description Table
ECDT Embedded Controller Boot Resources Table
EINJ Error Injection Table
ERST Error Record Serialization Table
FACP Fixed ACPI Description Table (FADT)
FACS Firmware ACPI Control Structure
FPDT Firmware Performance Data Table
GTDT Generic Timer Description Table
HEST Hardware Error Source Table
MISC Miscellaneous GUIDed Table Entries
MSCT Maximum System Characteristics Table
MPST Memory Power StateTable
NFIT NVDIMM Firmware Interface Table
OEMx OEM Specific Information Tables
PCCT Platform Communications Channel Table
PHAT Platform Health Assessment Table
PMTT Platform Memory Topology Table
PPTT Processor Properties Topology Table
PSDT Persistent System Description Table
RASF ACPI RAS Feature Table
RAS2 ACPI RAS2 Feature Table
RSDT Root System Description Table
SBST Smart Battery Specification Table
SDEV Secure DEVices Table
SLIT System Locality Distance Information Table
SRAT System Resource Affinity Table
SSDT Secondary System Description Table
SVKL Storage Volume Key Data table in the Intel Trusted Domain Extensions.
XSDT Extended System Description Table

Signatures for tables reserved by ACPI 這部分將 ACPI 保留的特定 Signature做整理。

Signature Description
AEST Arm Error Source Table.
AGDI Arm Generic Diagnostic Dump and Reset Interface.
APMT Arm Performance Monitoring Unit table.
BDAT BIOS Data ACPI Table – exposing platform margining data.
BOOT Reserved Signature
CEDT CXL Early Discovery Table.
CSRT Core System Resource Table.
DBGP Debug Port Table.
DBG2 Debug Port Table 2.
DMAR DMA Remapping Table.
DRTM Dynamic Root of Trust for Measurement Table.
DTPR DMA TXT Protected Range.
ETDT Event Timer Description Table (Obsolete). IA-PC Multimedia Timers Specification. This signature has been superseded by “HPET” (below) and is now obsolete.
HPET IA-PC High Precision Event Timer Table.
IBFT iSCSI Boot Firmware Table.
IERS Inline Encryption Reporting Structure.
IORT I/O Remapping Table.
IVRS I/O Virtualization Reporting Structure.
KEYP Key Programming Interface for Root Complex Integrity and Data Encryption (IDE).
LPIT Low Power Idle Table.
MCFG PCI Express Memory-mapped Configuration Space base address description table. PCI Firmware Specification, Revision 3.0.
MCHI Management Controller Host Interface table. DSP0256 Management Component Transport Protocol (MCTP) Host Interface Specification.
MHSP Microsoft Pluton Security Processor Table.
MPAM Arm Memory Partitioning And Monitoring.
MSDM Microsoft Data Management Table.
NBFT NVMe-over-Fabric (NVMe-oF) Boot Firmware Table.
PRMT Platform Runtime Mechanism Table.
RGRT Regulatory Graphics Resource Table.
SDEI Software Delegated Exceptions Interface.
SLIC Microsoft Software Licensing table.
SPCR Microsoft Serial Port Console Redirection table.
SPMI Server Platform Management Interface table.
STAO _STA Override table.
SWFT Sound Wire File Table table.
TCPA Trusted Computing Platform Alliance Capabilities Table. TCPA PC Specific Implementation Specification.
TPM2 Trusted Platform Module 2 Table.
UEFI Unified Extensible Firmware Interface Specification.
WAET Windows ACPI Emulated Devices Table.
WDAT Watch Dog Action Table. Requirements for Hardware Watchdog Timers Supported by Windows - Design Specification.
WDDT Watchdog Descriptor Table. The table passes Watchdog-related information to the OS.
WDRT Watchdog Resource Table. Watchdog Timer Hardware Requirements for Windows Server 2003.
WPBT Windows Platform Binary Table.
WSMT Windows Security Mitigations Table.
XENV Xen Project.

上一篇
[Day 8] ACPI
下一篇
[Day 11] ACPI
系列文
我的第一個 BIOS 與 Web API 應用程式15
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言