Contribute
Register

[Guide] How to patch DSDT for working battery status

hello,RehabMan,This is my ioreg. I can't find the relevant content according to your posts. Is there any way to solve the problem of power display?
 

Attachments

  • debug_18045.zip
    2.8 MB · Views: 65
Hi @RehabMan,

I followed your guide and battery icon shows up in the menubar, but the problem is it always shows 99% when AC plugged in, and 100% when AC unplugged. Battery status is right under windows. Can you take a look at this?

Thanks!
 

Attachments

  • debug_10032.zip
    1.3 MB · Views: 67
  • patch.txt
    11.3 KB · Views: 69
  • DSDT-common-patches.dsl
    433.1 KB · Views: 69
Last edited:
Greetings - I am attempting to patch my DSDT to get the battery status working. I have followed the guide in the first post and have created a text file of the patch. I am anything but a coder, so it is probably wrong in many ways, so if someone could take a look, I would appreciate it. I can tell you for sure that the offsets are totally wrong - I have changed the text color for those to RED. I have no idea how to calculate the offsets.

Also, I am not sure how to apply the patch in MaciASL. Once I get the DSDT patched, should it be placed in /EFI/EFI/CLOVER/ACPI/patched?

I have attached the patch as well as all the problem reporting files.

Thanks!
 

Attachments

  • Archive.zip
    5 MB · Views: 67
How to patch DSDT for working battery status



Firstly, TD31 is already 8-bits. No need to patch it.

Let's use TD38 as an example instead.

First of all, don't convert TD38 to TD38 and TD39. Always change the name, such that the compiler can find all places the old name was used. That way you won't inadvertently miss anything.

I would translate TD38,16 to TX38,8,TX39,8.

Assuming you had a Store(Arg1,TD38) somewhere, translation would be:
Store(ShiftRight(Arg1,8), TX39)
I am wondering does order of these two commands matter?
Store(ShiftRight(Arg1,8), TX39)
Store(Arg1,TX38)
Can we translate to
Store(Arg1,TX38)
Store(ShiftRight(Arg1,8), TX39)
?
 
Greetings - I am attempting to patch my DSDT to get the battery status working. I have followed the guide in the first post and have created a text file of the patch. I am anything but a coder, so it is probably wrong in many ways, so if someone could take a look, I would appreciate it. I can tell you for sure that the offsets are totally wrong - I have changed the text color for those to RED. I have no idea how to calculate the offsets.

Also, I am not sure how to apply the patch in MaciASL. Once I get the DSDT patched, should it be placed in /EFI/EFI/CLOVER/ACPI/patched?

I have attached the patch as well as all the problem reporting files.

Thanks!
One thing I have just noticed is that when the laptop wakes from sleep, it says that the battery is low and the battery status is showing in the menu bar (the laptop is plugged in and the battery is fully charged). I assume this is because the DSDT is not patched, but the ACPIBatteryManager.kext has been installed.
 
Hi,
I have successfully patched the DSDT of my notebook, and the battery is showing up in the toolbar, but it just stays at 0%. I would very much appreciate if someone could take a look at it and help me.
Every file mentioned in the troubleshooting part is attached.
Thanks.
Your kextcache output proves kexts are not installed correctly.
All kexts you need must be installed to the system volume.
Read post #2 of the Clover guide for details:

And you can use the debug version of ACPIBatteryManager.kext to get additional kernel logs that may be helpful in determining the problem.
 
I am wondering does order of these two commands matter?
Store(ShiftRight(Arg1,8), TX39)
Store(Arg1,TX38)
Can we translate to
Store(Arg1,TX38)
Store(ShiftRight(Arg1,8), TX39)
?

The order likely does not matter.
 
The "HP G6 2221ss" matched my DSDT. I have applied it, I also changed to Windows 10 for OS Check Fix. But I'm still having incorrect percentage readings for my battery. After draining the battery, and then charging, it shows correct readings. But once I unplug my power adapter or reboot, it gets stuck on the last reading and never moves again. I have the debug version of the battery kext installed. Here are my troubleshooting files. Thanks

See notes in "HP G6 2221ss" patch regarding INIT/ACEL.
 
Hi
@RehabMan I'm having a few issues after patching my DSDT on my new laptop.

1. The battery percentage appears to be reporting accurately, however I get this:
View attachment 380250

2. Also there is no detection of the AC adapter being present at any time (it was plugged in when the above screenshot was taken, for example).

3. Finally, with ACPIBatteryManager loaded the laptop's fans are running a lot more frequently and a lot faster than otherwise. Even under 12% CPU load they are extremely loud.

Any help or advice would be appreciated! Thank you in advance!

Use debug ACPIBatteryManager.kext, analyze related kernel logs.
Keep in mind older versions of ACPIBatteryManager.kext use a different technique to detect AC status (worth trying).
 
AC Power adapter presence is now correctly detected after dropping SSDTs. Fan noise is still unaffected (it's REALLY bad).

Updated error reporting files attached.

Additional: Out of interest, I installed the FakeSMC monitoring kexts and HWMonitor -- on AC power the CPU is running x34 multipliers pretty much all the time (it does step down occasionally) and x32 on battery. I wonder if there is a way of changing this?

Have opened a new thread for my problem. (Click here)

Non-battery related issues are off-topic.
Such issues should be presented in a separate thread.
 
Back
Top