BIOS ACPI TABLE

本文介绍了ACPI(高级配置与电源接口)中的关键表格,包括根系统描述表(RSDT)、固定ACPI描述表(FADT)、差异化系统描述表(DSDT)等。这些表格在操作系统启动过程中起到核心作用,提供了硬件配置和电源管理所需的数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<!-- @page { size: 21cm 29.7cm; margin: 2cm } P { margin-bottom: 0.21cm } H3 { margin-bottom: 0.21cm } H3.western { font-family: "文鼎PL中楷Uni", serif } H3.cjk { font-family: "文鼎PL细上海宋Uni"; font-style: normal } H3.ctl { font-family: "文鼎PL细上海宋Uni" } --> bibliography:

http://www.books24x7.com/book/id_6137/viewer.asp?bookid=6137&chunkid=0441939724

 

The Root System Description Table (RSDT) is the directory to all the other description tables, providing the operating system access to all the available ACPI data

RSDT is stored in the last 64KB below TOM.

 

Fixed ACPI Description Table (FADT)

Data in the FADT includes fixed-length entries describing the fixed ACPI features of the hardware

It also has the physical addresses of the Differentiated System Description Table (DSDT) and Firmware ACPI Control Structure (FACS)

 

Differentiated System Description Table (DSDT)

Differentiated Definition Block that contains implementation and configuration information beyond what's in the ACPI hardware registers the OSPM uses for power management, thermal management, or Plug and Play.

DSDT is a required table located at offset 0 in the segment from TOM-128K to TOM-64K

(TOM = top of memory)

 

RSDT--> FADT --> DSDT

 

SSDT—Secondary System Description Table

 

PSDT—Persistent System Description Table

The PSDT has been removed from the ACPI 2.0 specification

 

MADT—Multiple APIC Description Table

 

FACS—Firmware ACPI Control Structure

The FACS contains the system’s hardware signature at last boot, the firmware waking vector, and the global lock

 

 

When the system boots, OSPM uses the E820 BIOS call to obtain a system memory map

The BIOS should decide where the different memory structures belong and configure the E820 handler to return the appropriate values

 

For this example, the BIOS reports the system memory map by E820 as shown: Figure 1

 

The BIOS has set aside memory from the Top of Memory1 to Top of Memory2 as ACPI NVS Memory and Reserved Memory, and has marked both as reserved. A legacy operating system throws out the ACPI NVS Memory and marks this area as reserved memory, preventing the memory range from being allocated to any add-in device.

Operating System Loading

To see Figure 2

 

 

BIOS在系统启动过程中扮演着初始化硬件和加载操作系统的重要角色,而ACPI(高级配置与电源接口)表则是BIOS向操作系统传递硬件配置和电源管理信息的关键机制。BIOS读取并构建ACPI表格的过程主要包括以下几个方面: ### ACPI表的生成与存储 BIOS在启动早期阶段会初始化芯片组、内存控制器等关键硬件,并根据平台设计生成一组ACPI表。这些表格通常包括RSDP(Root System Description Pointer)、RSDT(Root System Description Table)、DSDT(Differentiated System Description Table)以及其他可选的SSDT(Secondary System Description Table)等[^1]。这些表格会被放置在物理内存中的特定位置,确保操作系统能够找到它们。 RSDP是ACPI表结构的入口点,它包含了一个指向RSDT或XSDT(扩展系统描述表)的指针。RSDT/XSDT则列出了所有其他ACPI表的地址和大小,从而允许操作系统遍历整个ACPI表结构来获取必要的信息[^1]。 ### BIOS如何构建ACPIBIOS通过固件代码中的ACPI表生成模块来创建这些表格。这个过程涉及到对硬件特性的硬编码或者从配置数据库中提取数据。例如,在龙芯平台上,随着固件到内核接口规范升级至UEFI 3.0,BIOS使用ASL(ACPI Source Language)语言编写描述硬件行为的代码,然后编译成AML(Abstract Machine Language),最终作为DSDT的一部分被嵌入到ACPI表中[^2]。 当BIOS准备好所有的ACPI表后,它会将RSDP放置在一个预定义的物理内存地址上,通常是低地址范围(如0x000E0000至0x000FFFFF)。这样做的目的是为了让后续的操作系统加载器可以轻松找到并解析这些表。 ### BIOS向操作系统传递ACPI信息 一旦ACPI表被正确地建立并且RSDP位于正确的位置,BIOS就会继续执行POST(加电自检)流程。当控制权即将转移给操作系统时,BIOS会在启动参数中提供有关ACPI表的信息,比如RSDP的物理地址。对于UEFI系统来说,EFI系统表提供了关于ACPI表的引导服务,使得操作系统可以直接访问这些表[^1]。 此外,BIOS还可能支持动态修改某些ACPI表的能力,尤其是在需要调整电源管理设置或更新硬件描述的情况下。这种情况下,BIOS可能会预留一部分区域用于运行SMI(System Management Interrupt)处理程序,以响应来自操作系统的特定命令,如启用或禁用某些ACPI功能[^3]。 综上所述,BIOS通过对硬件的初始化和配置,构造出符合标准的ACPI表,并将其安置于内存中指定位置,同时通过标准接口告知操作系统这些表的位置,以此完成对ACPI信息的读取和传递。 ```c // 示例伪代码展示BIOS如何安装一个标准ACPIACPI_STATUS status; UINT32 table_index; status = acpi_tb_install_standard_table(address, ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, FALSE, TRUE, &table_index); if (ACPI_SUCCESS(status) && ACPI_COMPARE_NAME(&acpi_gbl_root_table_list.tables[table_index].signature, ACPI_SIG_FADT)) { acpi_gbl_fadt_index = table_index; acpi_tb_parse_fadt(); // 解析FADT表 } ``` 上述代码片段展示了BIOS内部如何调用ACPI核心子系统提供的函数来安装一个标准的ACPI表,其中`acpi_tb_install_standard_table`负责实际安装工作,而`acpi_tb_parse_fadt`则专门用来解析FADT(Fixed ACPI Description Table)表。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值