[ Prev ] [ Index ] [ Next ]

imageTodo: This document has sections that are still in the old non-markup form

ACPI is the Advanced Configuration and Power Interface is part of the BIOS and is used to monitor the state of attributes of hardware devices such the cpu frequency and temperature, or the battery amps or the video rom and so on.

In linux, the acpi information is made available within the /proc filesystem. Each APCI monitored device has an entry in the /proc filesystem and within each entry, there is typically at least a "state" and "info" file.

The ACPI project is currently located at http://acpi.sourceforge.net

1. Devices and interpretation

The following is a (not complete) list of ACPI devices and what hardware
they releate to:
* lid (/proc/acpi/button/lid) - This is the state of a laptop lid 
* battery (/proc/acpi/battery/BAT1) - The 1st battery (on some systems this is BAT0)
* AC-Adapter (/proc/acpi/ac_adapter/ACAD/state)
* CPU Temp (/proc/acpi/thermal_zone/ATF0/temperature)
* CPU Frequency (/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
* Power button (/proc/acpi/button/power) - The button state

2. DMI Table

The DMI table (also called the SMBIOS table) contents can be viewed using
dmidecode. The table contains a description of the system’s hardware components,
as well as other useful pieces of information such as serial numbers and BIOS 
revision.
bash # dmidecode

3. Including a custom DSDT in the kernel

Get the original DSDT:
bash # cp /proc/acpi/dsdt DSDT
bash $ acpixtract DSDT acpidump > DSDT
Disassemble, make changes and then compile:
    bash $ iasl -d DSDT
    bash $ vi DSDT.dsl
    bash $ iasl -tc DSDT.dsl
Put the new DSDT where the kernel build can include it:
bash $ cp DSDT.hex <kernel src>/include/
Modify kernel .config to set inform the new kernel that a custom ACPI
DSDT is being used:
CONFIG_STANDALONE=n
CONFIG_ACPI_CUSTOM_DSDT=y
CONFIG_ACPI_CUSTOM_DSDT_FILE="DSDT.hex"
Make the kernel and off you go. You should see in dmesg:
Table [DSDT] replaced by host OS
Note that with "CONFIG_ACPI_DEBUG=y", ASL store operations to the special object 
"Debug" will be made available to the dmesg output, e.g.,
Store("hello world!", Debug)
Store(Local0, Debug)
[ACPI Debug]  String: [0x0C] "hello world!"
[ACPI Debug]  Integer: 0x00000042

No backlinks to this page.