第二十三篇:Windows中的ACPI

一直不太清楚ACPI驱动在WINDOWS中的作用.

甚至不了解ACPI协议的作用.


先来看一断解释:

ACPI is layer between platform firware and os. ACPI contains different tables 
which are populated by platform firmare (bios/ uefi) during booting, these 
tables contains the details of attached peripherals  one of the table is 
Differentiated System Description Table (DSDT) which contains the details of 
pci/pcie devices (bus, device and function- bdf). These tables are stored in 
memory and available to os after firmware handover control to os.
os reads the tables and understand the details of attached devices. now its os's 
responsibility to configure and initialize the attached devices by identifying 
and loading the correct driver for devices. It also helps in hot plug pcie 
devices.


于是, 随便翻了下"格蠹汇编"中的第24章, 如何跟踪ACPI代码, 算是对ACPI有了一个初步性的了解.

ACPI向OS报告硬件信息, 而OS通过ACPI控制硬件.

ACPI就是OS与硬件/固件之间的一个标准接口协议.

ACPI通过ASL(ACPI SOURCE LANGUAGE)来描述系统硬件的属性与方法, ASL最终会被编译为AML(ACPI MACHINE LANGUAGE)的字节码(BYTECODE).


之后, 翻阅了一下WDK中关于ACPI的内容:

ACPI设备包括:

low-level system devices such as batteries, thermal zones, and other devices defined in a system'sACPI namespace.


ACPI设备在WINDOWS驱动中的表现形式: 

即definition block和它其中的一块operation region.

An ACPI device is specified by a definition block in the ACPI System Description Tables. A device's definition block specifies, among other things, anoperation region, which specifies a contiguous block of device memory that is used to access device data.


ACPI设备的Windows软件构成:

1. ACPI系统驱动ACPI.SYS

2. vendor提供的WDM驱动

3. ACPI BIOS, 就是所谓的固件

这一组合的操作流程是:ACPI.SYS调用vendor提供的WDM驱动中的operation region handler来访问operation region, 以达到对ACPI设备数据/控制的目的.


关于设备堆栈:

分为该APCI设备是主板集成的, 则ACPI驱动建立FDO, 位于WDM驱动建立的FDO之下, 位于ROOT BUS驱动建立的PDO之上

如果不是主板集成的, 则ACPI为该设备建立PDO, 位于WDM建立的FDO之下.


ACPI的控制方法:

所谓的ACPI控制方法, 就是由ASL/AML描述的用来查询与配置硬件的软件.

由ACPI驱动负责解释执行.

Control methods are written in the ACPI Machine Language (AML), loaded from the system firmware into the ACPI namespace, and interpreted by the ACPI driver.


ACPI的命名规则:

\ root of ACPI namespace
ABCD parent device (缩进一次)
CHL1 child device of ABCD (缩进二次)
CHL2 child device of ABCD (缩进二次)
CHL3 child device of CHL2 (缩进三次)
_FOO control method (缩进三次)
_FOO control method  (缩进一次)

WINDOWS对ACPI设备的命名由对象来表述(object), 一个对象可以包括子对象, 而对象既可以是子设备(child device), 也可以是控制方法(control method).


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值