本文主要浅谈自己对ACPI DSDT table的理解。

Differentiated System Description Table (DSDT) for system configuration info. DSDT is a major ACPI table used to describe what peripherals the machine has, and information on PCI IRQ mappings and power management.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
DefinitionBlock ("", "DSDT", 2, "", "", 0x0)
{
Scope (\_SB)
{
Device (PCI0)
{
Name (INT1, 0x1234)
Name (_HID, EisaId ("PNP0A08") /* PCI Express Bus */)
Name (_CID, EisaId ("PNP0A03") /* PCI Bus */)
Method (^BN00, 0, NotSerialized)
{
Return (0x12 + INT1)
}

Method (_BBN, 0, NotSerialized)
{
Return (BN00 ())
}

Name (_UID, 0x00) // _UID: Unique ID

OperationRegion (MCHT, SystemMemory, 0xFED10000, 0x6000)
Field (MCHT, ByteAcc, NoLock, Preserve)
{
Offset (0x5994),
RPSL, 8,
Offset (0x5998),
RP0C, 8,
RP1C, 8,
RPNC, 8
}
}
}
}

Once a file containing ASL similar to this example is compiled, the file is packaged as firmware. During the initialization of the OS, a namespace hierarchy is created and helps the OS find devices and initialize drivers for them. The following diagram illustrates this concept.

这是我曾经提交过的pr dm:gvt:update bus0 memlimit32 value,该patch与DSDT相关。


参考资料:

  1. Device Model high-level design
  2. ACPI Source Language (ASL) Tutorial