ProjectOSX

Welcome Guest!

Returning User? Login here.

Want membership privileges? Register here.

> DSDT

Differentiated System Description Table (DSDT) - DSDT is a part of the ACPI specification and it supplies configuration information about a base system. ACPI capable computers come with a preinstalled DSDT from the manufacturer. A common Linux/OS X problem is missing ACPI functionality (fans not running, laptop screens not shutting off, etc.)

This subforum is dedicated to patches/fixes able to be inserted/modified from an extracted dsdt.dsl, which is then compiled into a DSDT.aml for OS X to pick up and use (with a proper bootloader).

These fixes are not permanent, and do not damage your BIOS.

 
Start a new topic Add Reply
> ACPI Debugging
zhell
post Aug 11 2009, 03:24 PM
Post #1
ACPI Debugging

This is for advanced users experienced with DSDT modification ONLY

As a primer, read a few of the 700+ pages of the ACPI specs from here: http://www.acpi.info/spec.htm

Many issues related to power management (speedstep, sleep and hibernation etc.) are governed by your board's ACPI tables.
Debugging ACPI is a royal pain as often the display is off when you would like it to output debug info.
Using a second machine you can attach to the kernel and obtain valuable data, but I have never done this myself. Rather, I'm collecting here hints on how to debug ACPI using facilities available to all of us.


Kernel Arguments

First off, using these kernel arguments, you can obtain some output to the console:
CODE
-v acpi_layer="ACPI_ALL_COMPONENTS ACPI_ALL_DRIVERS" acpi_level="ACPI_LV_ALL_EXCEPTIONS" debug=0x12a

In order to see the console at all times, set "Display login window" to "Name and password" in System Preferences/Accounts/Login Options; then log out and enter ">console" as user name and an empty password. Now you can log in on the console (type your user name, hit enter, then type your password).
To put the machine to sleep from the console, use
CODE
sudo pmset sleepnow



DSDT Debug Code

ACPI allows some debug code to be output by writing to the debug device, however if the display is off, this is useless. Instead, you can send some morse code using the power LED.
Here is an example snippet I added to my _WAK method that flashes the power LED and thus shows me, where in _WAK it is hanging on resume.
CODE

Method (_WAK, 1, Serialized)
{
Store ("Method _WAK begin...", Debug)
/*
* Blink power led slow 3 times */
Store (0x0F, \_SB.PCI0.LPCB.LED)
Sleep (0x1f4)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x1f4)
Store (0x0F, \_SB.PCI0.LPCB.LED)
Sleep (0x1f4)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x1f4)
Store (0x0F, \_SB.PCI0.LPCB.LED)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x1f4)
/*
* Enough */

\_SB.PCI0.LPCB.WAK (Arg0)
/*
* Blink power led long on 3 times */
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x0F, \_SB.PCI0.LPCB.LED)
Sleep (0x1f4)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x0F, \_SB.PCI0.LPCB.LED)
Sleep (0x1f4)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x0F, \_SB.PCI0.LPCB.LED)
/*
* Enough */
Store ("Called method WAK returned", Debug)

If (CondRefOf (_OSI, Local0))
{
Store (0x21, OSTY)
}

/*
* Blink power led long off 3 times */
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x1f4)
Store (0x0F, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x1f4)
Store (0x0F, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x1f4)
Store (0x0F, \_SB.PCI0.LPCB.LED)
/*
* Enough */

Notify (\_SB.PCI0.UHC1, Zero)
Notify (\_SB.PCI0.UHC2, Zero)
Notify (\_SB.PCI0.UHC3, Zero)
Notify (\_SB.PCI0.UHC4, Zero)
Notify (\_SB.PCI0.UHC5, Zero)
Notify (\_SB.PCI0.UHC6, Zero)
Notify (\_SB.PCI0.EHC1, Zero)
Notify (\_SB.PCI0.UHCX, Zero)
Notify (\_SB.PCI0.EHC2, Zero)

If (LEqual (Arg0, 0x04))
{
If (LEqual (WAS4, One))
{
Notify (\_SB.SLPB, 0x02)
}
}


Store ("Method _WAK end", Debug)
/*
* Blink power led fast 6 times */
Sleep (0x64)
Store (0x0F, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x0F, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x0F, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x0F, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x0F, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x02, \_SB.PCI0.LPCB.LED)
Sleep (0x64)
Store (0x0F, \_SB.PCI0.LPCB.LED)
/*
* Enough */

Return (Zero)
}

You need to find out how to turn on and off the power LED on your own, as this is totally specific to each board. As a hint, look at method _PTS, as this method usually turns off the power LED.
I admit that this code should be replaced by a dedicated method which takes as argument a string and flashes the power LED accordingly to the morse code representation of the string. Writing this method is left as an exercise for the reader. Please post your solutions below :-)

USB Debugging

Many issues related to sleep are related to USB and I recommend to install the debug version of the USB kexts. You can obtain them from this page (requires free ADC membership): http://developer.apple.com/hardwaredrivers...d/usbdebug.html

This post has been edited by zhell: Aug 11 2009, 03:32 PM
GA-Z68MX-UD2H-B3-U1c | Core i7 2600 | 16GB DDR3-1600
Intel SSD 520 240GB + WDC WD-20EARX 2TB Fusion drive
Sapphire Radeon HD 6850 1024MB PEG | Atheros AR9380 Mini PCIe | Intel 82574L PCIe
OS X 10.8.2 | Chameleon 2.1svn | Clover EFI r897
18seven
post Aug 11 2009, 07:28 PM
Post #2
Thanks for posting this info. That led diagnostic is wicked cool. I am currently deep into section 8 of the acpi specs trying to resolve why ApplePowerManagement has cut my CPU max frequency in half. Getting some info into console will hopefully give me a better shot than stabbing in the dark with a serious learning curve. Any sage wisdom would be most welcome.

Slice
post Aug 12 2009, 07:34 AM
Post #3
Cool! blink.gif
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.4), OS⌘10.9.1, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
apocolipse269
post Aug 12 2009, 04:57 PM
Post #4
Question for you, i've been reading up on ACPI trying to fix my sleep issue, however i do think it is kext related (would like to fix my dsdt to use stock acpi kexts if i can eventually but...)
Currently my issue with sleep is that it will hang after wak, it will get up to the UI but it seems no disk i/o afterwards, then get loading cursor after a few secs and have to hard boot. i fixed the compile errors about no return values in my dsdt and still get this, wondering if thsi could be usb related (hopefully) so i dont have to keep wrackin my head and potentially mess up my compy messin w/ dsdt too much
alex
post Sep 20 2009, 03:17 PM
Post #5
QUOTE (apocolipse269 @ Aug 12 2009, 04:57 PM) *
Question for you, i've been reading up on ACPI trying to fix my sleep issue, however i do think it is kext related (would like to fix my dsdt to use stock acpi kexts if i can eventually but...)
Currently my issue with sleep is that it will hang after wak, it will get up to the UI but it seems no disk i/o afterwards, then get loading cursor after a few secs and have to hard boot. i fixed the compile errors about no return values in my dsdt and still get this, wondering if thsi could be usb related (hopefully) so i dont have to keep wrackin my head and potentially mess up my compy messin w/ dsdt too much


Apocolipse I have exacly the same issue with sleep, have you managed to fixed it?
iMac3,1: Striker II Extreme (790i) -Intel QX9650 - EVGA 9800GX2 - 4GB OCZ ReaperX DDR3  10.6.1 Vanilla Kernel - FakeSMC.kext - OpenHaltRestart.kext - PlatformUUID.kext - AppleNForceATA.kext (-x32) - LegacyAppleLPC.kext - LegacyAD1988B.kext - LegacyACPI_SMC_PlatformPlugin.kext - LegacyJMB36xSATA.kext - com.apple.boot.plist with GFX EFI strings - DSDT.aml with OHCI/EHCI HPET HDEF fixes. Sleep and vanilla throttling don't work.
Mikehunt79
post Sep 23 2009, 02:44 AM
Post #6
nice idea with the morse code, I wonder if you could get the console to log it's output to a file?
ytrox
post Aug 18 2011, 11:47 AM
Post #7
can you post a dsdt example please?

This post has been edited by ytrox: Aug 19 2011, 01:52 AM

Add Reply Start a new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: