Contribute
Register

[Guide] How to patch DSDT for working battery status

You're probably right, I upgraded to 10.10.5 in the middle of DSDT patching. And that is probably where it got complicated. Re-installed to 10.10.4.
Once more unto the breach...
 
You're probably right, I upgraded to 10.10.5 in the middle of DSDT patching. And that is probably where it got complicated. Re-installed to 10.10.4.
Once more unto the breach...

Now see if you can update to 10.10.5. No difference that I've heard of regarding these two components...
 
Hi Rehabman,

no dice, still not displaying battery status in menu bar at 10.5. But displaying well 10.4.

I created patched DSDT from a fresh extract - no SSDT patched yet. I fixed the BST to return a default voltage value(0x450), when read voltage is unknown. At Bat1 and Bat2 return (0) immediately, but I forgot to removed the rest of the code. I will do that tomorrow.

For some reason, whenever I unplugged the AC. Console displays STA = 0x1f but errors on BIF and BST from ACPIBattery. This happens on both versions. The ACPIDebug shows like an abrupt interruption(not always stops on the same line), like a thread is running then suddenly dropped and the succeeding process that calls it breaks. Don't know if this is the case. Just an analogy.

But that not seems to be the problem because at 10.5, it is not displaying at all. And no matter what I do on the plug at 10.4 the battery status stays displayed.

Any idea?

PS: I reverted to a refined ALPS VoodooPS2 on both versions. DiskUtility and a jumpy cursor is not good mix at all.
 
Hi Rehabman,

no dice, still not displaying battery status in menu bar at 10.5. But displaying well 10.4.

I created patched DSDT from a fresh extract - no SSDT patched yet. I fixed the BST to return a default voltage value(0x450), when read voltage is unknown. At Bat1 and Bat2 return (0) immediately, but I forgot to removed the rest of the code. I will do that tomorrow.

For some reason, whenever I unplugged the AC. Console displays STA = 0x1f but errors on BIF and BST from ACPIBattery. This happens on both versions. The ACPIDebug shows like an abrupt interruption(not always stops on the same line), like a thread is running then suddenly dropped and the succeeding process that calls it breaks. Don't know if this is the case. Just an analogy.

You need to determine what is wrong with your DSDT code. An abrupt abort means the code did something that the ACPI interpreter didn't like.

Use ACPIDebug to determine the specific code causing the problem.
 
Background

Because the battery hardware in PCs is not compatible with Apple SMbus hardware, we use ACPI to access battery state when running OS X on laptops. Generally I recommend you use ACPIBatteryManager.kext, available here: https://github.com/RehabMan/OS-X-ACPI-Battery-Driver

Later releases of AppleACPIPlatform are unable to correctly access fields within the EC (embedded controller). This causes problems for ACPIBatteryManager as the various ACPI methods for battery fail (_BIF, _STA, _BST, etc). Although it is possible to use an older version of AppleACPIPlatform (from Snow Leopard), it is desirable to use the latest version of AppleACPIPlatform because with computers that have Ivy Bridge CPUs it enables native power management for those computers. To use the latest version, DSDT must be changed to comply with the limitations of Apple's AppleACPIPlatform.

In particular, any fields in the EC larger than 8-bit, must be changed to be accessed 8-bits at one time. This includes 16, 32, 64, and larger fields.

You should be familiar with the DSDT/SSDT patching fundamentals: http://www.tonymacx86.com/yosemite-laptop-support/152573-guide-patching-laptop-dsdt-ssdts.html

Existing Patches

First of all, it could be that there is patch already available for your laptop. See my patches at: https://github.com/RehabMan/Laptop-DSDT-Patch

In order to match your DSDT with a patch, it is often necessary to understand how the patches are made in the first place, so you know what to look for in your DSDT and can match what you see with the patches already available.

*** Note: Do not use DSDT Editor or any program other than MaciASL. I do not test my patches with DSDT Editor. I test only with MaciASL.

Other relevant DSDT patches

In addition to the multi-byte EC fields, there are a few other DSDT issues that can affect battery status. These particular problems are not specific to battery status, but they are usually noticed for the first time when trying to implement battery status.

The battery code may depend on having a recognized version of Windows as the host OS. To fix, apply "OS Check Fix" from the laptop DSDT patch repository. This will cause the DSDT to take the same actions as it would when running "Windows 2006" You can change the patch to effect different selections (eg. "Windows 2012".

Another common problem is the fact that OS X's ACPI implementation has difficulty with Mutex objects declared with a non-zero SyncLevel (for more info read the ACPI spec). To fix, apply "Fix Mutex with non-zero SyncLevel" from the laptop DSDT patch repository.


My battery status stopped working after unchecked (and rechecked) "Show battery status in menu bar" in Energy Settings. How can I get it to work again? I tried reinstalling the kext, rebuilding cache, rebuilding all my dsdt patches and I've installed check OS-fix and fix Mutex.

This is my first hackintosh and I am doing my best to learn and troubleshoot problems on my own, but it seems like I am stuck here. Help would be greatly appreciated. :) Please excuse me if I made stupid mistakes. <3
 
My battery status stopped working after unchecked (and rechecked) "Show battery status in menu bar" in Energy Settings. How can I get it to work again? I tried reinstalling the kext, rebuilding cache, rebuilding all my dsdt patches and I've installed check OS-fix and fix Mutex.

This is my first hackintosh and I am doing my best to learn and troubleshoot problems on my own, but it seems like I am stuck here. Help would be greatly appreciated. :) Please excuse me if I made stupid mistakes. <3

Download patchmatic: https://bitbucket.org/RehabMan/os-x-maciasl-patchmatic/downloads/RehabMan-patchmatic-2015-0107.zip
Extract the 'patchmatic' binary from the ZIP. Copy it to /usr/bin, such that you have the binary at /usr/bin/patchmatic.

In terminal,
Code:
if [ -d ~/Downloads/RehabMan ]; then rm -R ~/Downloads/RehabMan; fi
mkdir ~/Downloads/RehabMan
cd ~/Downloads/RehabMan
patchmatic -extract

Note: It is easier if you use copy/paste instead of typing the commands manually.

Post contents of Downloads/RehabMan directory (as ZIP).

Also, post ioreg: http://www.tonymacx86.com/audio/58368-guide-how-make-copy-ioreg.html. Please, use the IORegistryExplorer v2.1 attached to the post! DO NOT reply with an ioreg from any other version of IORegistryExplorer.app.

And output from:
Code:
kextstat|grep -y acpiplat
kextstat|grep -y appleintelcpu
kextstat|grep -y applelpc

Also, post EFI/Clover folder.
 
You need to determine what is wrong with your DSDT code. An abrupt abort means the code did something that the ACPI interpreter didn't like.

Use ACPIDebug to determine the specific code causing the problem.

ok, will rest rest for now. Then check ACPI specs to figure out where to plug ACPIDebug. Thank you Rehabman.
 
The ioreg shows battery status methods (_BIF and/or _BST) failing. Check in system.log using the debug ACPIBatteryManager.kext for more info.
Thanks! I'll go do that. :)
 
Hi, I currently own a Toshiba E45-B4200, Intel Core I5 4200U with 6GB of ram running Mac OSX 10.10.5. I've got everything working except for the battery percentage. While it is functional, as soon as it gets to 100% (when using AC) the lightning symbol disappears and changes its text to say Power Source:battery. This doesn't let me use my power saver features. :( Do you have any idea why it does this?I am posting my IOreg and DSDT thank you!
View attachment DSDT.aml
View attachment Jun’s MacBook Pro.ioreg

Edit: I got it working! I just applied the Toshiba Satellite patch that was in the Laptop Patches and then applied a code for the Asus Laptops having the same problem! :headbang:
 
Back
Top