Contribute
Register

[Guide] How to patch DSDT for working battery status

Joined
Dec 20, 2018
Messages
700
Motherboard
Gigabyte Z370 AORUS Gaming 7
CPU
i7-8700K OC 5GHz
Graphics
GTX 1080 Ti & UHD 630
Mac
  1. iMac
  2. MacBook Pro
  3. Mac Pro
Mobile Phone
  1. iOS
I am using a DELL Inspiron 5370 which has a 38 Wh battery. Even though the laptop is only 9 months old, the Battery indicator shows Service Battery. I went through my DSDT, but I could not find any register that is over 8 bits. Hence, I am not sure if that requires patching.

I am attaching my PR files, @RehabMan , would you care to have a look?
did you get this figured out? I'm having this same issue
 
Joined
Jun 27, 2019
Messages
6
CPU
i7-4810mq
Graphics
HD4600; HD8670M
Mac
  1. MacBook Air
Mobile Phone
  1. Android
I successfully enabled battery indicator on the up right cornor. But I noticed it gradually destorying my battery, since every time I charged battery from 0% to 100%, the full battery capacity decreased by 32mAh(checked from system report). Now it has dropped from 4400mAh to 3872mAh. What can I do now?
 

Attachments

  • DSDT_native.aml
    65.4 KB · Views: 142
  • DSDT.aml
    66.5 KB · Views: 145
Joined
Jun 5, 2018
Messages
36
Motherboard
ASUS ROG STRIX Z370-H Gaming
CPU
i5-8600K
Graphics
UHD 630
Mobile Phone
  1. iOS
Next we need to determine the offsets within the EC that these fields are placed. Keep in mind the sizes are in bits, but the offsets are in bytes. The offsets I have in the comments below are in hex. See if you can come up with the same numbers.

Code:
Field (ECOR, ByteAcc, NoLock, Preserve)
                    {
                        Offset (0xA0),
                        SBMX,128,//SBMN,128
                    }

                    Field (ECOR, ByteAcc, NoLock, Preserve)
                    {
                        Offset (0xA0),
                        SBDX,128,//SBDN,128
                    }
I have 0xA0 as Offset. Is something wrong here?

And also, the compiler shows this error
Screen Shot 2019-09-27 at 21.25.13.png

in this line:
Name (_IRC, 0x00) // _IRC: Inrush Current

help please
 

Attachments

  • DSDT.dsl
    445 KB · Views: 96
Joined
Jun 2, 2011
Messages
27
Motherboard
NUC6 Skull Canyon
CPU
I7-6770HQ
Graphics
Iris Pro 580
Mac
  1. MacBook Air
I try to start the edit for a new battery (chuwi aerobook), I save the DSDT and decompile, but when I open with MaciASL.
I start to edit and found only the first line with "EmbeddedControl" but after when the guide tell to search BDN0 I didn't find... I'm little confused.

I attach here the DSDT (both decompiled and to decompile)
Hi Yota79, were you able to get anywhere with this?
 
Joined
Nov 29, 2015
Messages
15
Motherboard
Intel Core i5-4210U
CPU
Intel Core i5-4210U
Graphics
Intel HD Graphics 4400
Mobile Phone
  1. Android
  2. iOS
I have been using hackintoshes since snow leopard and have always been a fan. When I used El Capitan I faced this issue where there was no battery status. I fixed it by patching DSDT at that time. After long time I installed a fresh installation of macOS Mojave on a new drive and to my SURPRISE, it showed battery percentage in the status bar by default. I was so happy that I now don't have to patch DSDT/SSDTs. But to my disappointment, the next day when I booted the same macOS, there was no battery percentage. I tried a few things and then without wasting any time I started with DSDT patching.
1) I patched the HP Spectre XT patch as it solved all the 8-bit issues from DSDT (no errors).
2) I saved the patched file as ASL file and then renamed it to DSDT-Battery.aml.
3) I put this file in EFI/CLOVER/ACPI/PATCHED dir.
4) Install ACPIBatteryManager kext from rehbman downloads.

Now all I can see is 0% battery in the statusbar. I have tried everything and nothing works.
Can someone help me with this?

I have attached the details with this thread.

Hardware specifications:
Intel Core i5-4210U with Intel HD Graphics 4400 (1.7 GHz, 3 MB cache, 2 cores)
12 GB 1600 MHz DDR3L SDRAM (8 + 4 GB)
NVIDIA GeForce 820M (2 GB DDR3 dedicated)
500 GB 5400 rpm SATA

Thanks in advance.
 

Attachments

  • CLOVER.zip
    1.8 MB · Views: 184
  • ioreg.zip
    460.5 KB · Views: 193
  • kextstat-output.zip
    917 bytes · Views: 153
  • RehabMan.zip
    49 KB · Views: 180
  • touchextensions-output.zip
    1.1 KB · Views: 162
Joined
Jan 15, 2010
Messages
136
Motherboard
HP Omen 17-an011na
CPU
i7-7700HQ/HM175
Graphics
GTX 1050, HD 630
Mac
  1. Mac Pro
Classic Mac
  1. iMac
  2. Power Mac
Mobile Phone
  1. Android
I have been using hackintoshes since snow leopard and have always been a fan. When I used El Capitan I faced this issue where there was no battery status. I fixed it by patching DSDT at that time. After long time I installed a fresh installation of macOS Mojave on a new drive and to my SURPRISE, it showed battery percentage in the status bar by default. I was so happy that I now don't have to patch DSDT/SSDTs. But to my disappointment, the next day when I booted the same macOS, there was no battery percentage. I tried a few things and then without wasting any time I started with DSDT patching.
1) I patched the HP Spectre XT patch as it solved all the 8-bit issues from DSDT (no errors).
2) I saved the patched file as ASL file and then renamed it to DSDT-Battery.aml.
3) I put this file in EFI/CLOVER/ACPI/PATCHED dir.
4) Install ACPIBatteryManager kext from rehbman downloads.

Now all I can see is 0% battery in the statusbar. I have tried everything and nothing works.
Can someone help me with this?

I have attached the details with this thread.

Hardware specifications:
Intel Core i5-4210U with Intel HD Graphics 4400 (1.7 GHz, 3 MB cache, 2 cores)
12 GB 1600 MHz DDR3L SDRAM (8 + 4 GB)
NVIDIA GeForce 820M (2 GB DDR3 dedicated)
500 GB 5400 rpm SATA

Thanks in advance.
Have you tried a hard reset by holding the power button for 20 or so seconds with power etc disconnected? corruption can occur and stop a working patch. Also try naming it DSDT.aml.
 
Joined
Nov 29, 2015
Messages
15
Motherboard
Intel Core i5-4210U
CPU
Intel Core i5-4210U
Graphics
Intel HD Graphics 4400
Mobile Phone
  1. Android
  2. iOS
Have you tried a hard reset by holding the power button for 20 or so seconds with power etc disconnected? corruption can occur and stop a working patch. Also try naming it DSDT.aml.

Yes I have tried both these things.. Does my DSDT look good?
Thanks man..
 
Joined
Apr 14, 2013
Messages
86
Motherboard
Aorus Z370 Gaming 7
CPU
i7-8700K
Graphics
GTX 970
Mobile Phone
  1. iOS
I made a patch for my HP ProBook 430 G6. Seems to be working normally, haven't tested extensively yet though. Here it is in case anyone is interested:
Code:
into device label EC0 code_regex BDC,\s+16 replace_matched begin DC0,8,DC1,8 end;
into device label EC0 code_regex BFC,\s+16 replace_matched begin FC0,8,FC1,8 end;
into device label EC0 code_regex BRTE,\s+16 replace_matched begin RTE0,8,RTE1,8 end;
into device label EC0 code_regex BME,\s+16 replace_matched begin ME0,8,ME1,8 end;
into device label EC0 code_regex BDV,\s+16 replace_matched begin DV0,8,DV1,8 end;
into device label EC0 code_regex BCV1,\s+16 replace_matched begin CV10,8,CV11,8 end;
into device label EC0 code_regex BATE,\s+16 replace_matched begin ATE0,8,ATE1,8 end;
into device label EC0 code_regex BPR,\s+16 replace_matched begin BPR0,8,BPR1,8 end;
into device label EC0 code_regex BCR,\s+16 replace_matched begin CR0,8,CR1,8 end;
into device label EC0 code_regex BRC,\s+16 replace_matched begin RC0,8,RC1,8 end;
into device label EC0 code_regex BCC,\s+16 replace_matched begin CC0,8,CC1,8 end;
into device label EC0 code_regex BPV,\s+16 replace_matched begin PV0,8,PV1,8 end;
into device label EC0 code_regex BCV2,\s+16 replace_matched begin CV20,8,CV21,8 end;
into device label EC0 code_regex BCV3,\s+16 replace_matched begin CV30,8,CV31,8 end;
into device label EC0 code_regex BCV4,\s+16 replace_matched begin CV40,8,CV41,8 end;
into device label EC0 code_regex BATF,\s+16 replace_matched begin ATF0,8,ATF1,8 end;
into device label EC0 code_regex BCL,\s+16 replace_matched begin BCL0,8,BCL1,8 end;
into device label EC0 code_regex MAXC,\s+16 replace_matched begin AXC0,8,AXC1,8 end;
into device label EC0 code_regex BSTS,\s+16 replace_matched begin BST0,8,BST1,8 end;
into device label EC0 code_regex BSN,\s+16 replace_matched begin SN0,8,SN1,8 end;
into device label EC0 code_regex BDAT,\s+16 replace_matched begin BDA0,8,BDA1,8 end;
into device label EC0 code_regex CCBQ,\s+16 replace_matched begin CBQ0,8,CBQ1,8 end;
into device label EC0 code_regex CBT,\s+16 replace_matched begin CBT0,8,CBT1,8 end;
into device label EC0 code_regex ACPR,\s+16 replace_matched begin CPR0,8,CPR1,8 end;

into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;

into method label GACW code_regex \(ACPR, replaceall_matched begin (B1B2(CPR0,CPR1), end;
into method label GBAW code_regex \(BDV, replaceall_matched begin (B1B2(DV0,DV1), end;
into method label GBAW code_regex \(BDC, replaceall_matched begin (B1B2(DC0,DC1), end;
into method label BTIF code_regex \(BFC, replaceall_matched begin (B1B2(FC0,FC1), end;
into method label BTIF code_regex \(BDV, replaceall_matched begin (B1B2(DV0,DV1), end;
into method label BTIF code_regex \(BSN, replaceall_matched begin (B1B2(SN0,SN1), end;
into method label BTIF code_regex \(BDAT, replaceall_matched begin (B1B2(BDA0,BDA1), end;
into method label BTST code_regex \(BPR, replaceall_matched begin (B1B2(BPR0,BPR1), end;
into method label BTST code_regex \(BRC, replaceall_matched begin (B1B2(RC0,RC1), end;
into method label BTST code_regex \(BPV, replaceall_matched begin (B1B2(PV0,PV1), end;
into method label ITLB code_regex \(BFC, replaceall_matched begin (B1B2(FC0,FC1), end;
into method label GBTI code_regex \(BDC, replaceall_matched begin (B1B2(DC0,DC1), end;
into method label GBTI code_regex \(BFC, replaceall_matched begin (B1B2(FC0,FC1), end;
into method label GBTI code_regex \(BRC, replaceall_matched begin (B1B2(RC0,RC1), end;
into method label GBTI code_regex \(BME, replaceall_matched begin (B1B2(ME0,ME1), end;
into method label GBTI code_regex \(BCC, replaceall_matched begin (B1B2(CC0,CC1), end;
into method label GBTI code_regex \(CBT, replaceall_matched begin (B1B2(CBT0,CBT1), end;
into method label GBTI code_regex \(BPV, replaceall_matched begin (B1B2(PV0,PV1), end;
into method label GBTI code_regex \(BPR, replaceall_matched begin (B1B2(BPR0,BPR1), end;
into method label GBTI code_regex \(BSTS, replaceall_matched begin (B1B2(BST0,BST1), end;
into method label GBTI code_regex \(BDV, replaceall_matched begin (B1B2(DV0,DV1), end;
into method label GBTI code_regex \(BCV1, replaceall_matched begin (B1B2(CV10,CV11), end;
into method label GBTI code_regex \(BCV2, replaceall_matched begin (B1B2(CV20,CV21), end;
into method label GBTI code_regex \(BCV3, replaceall_matched begin (B1B2(CV30,CV31), end;
into method label GBTI code_regex \(BCV4, replaceall_matched begin (B1B2(CV40,CV41), end;
into method label GBTI code_regex \(BSN, replaceall_matched begin (B1B2(SN0,SN1), end;
into method label GBTI code_regex \(BDAT, replaceall_matched begin (B1B2(BDA0,BDA1), end;
into method label GBTI code_regex BDAT replaceall_matched begin B1B2(BDA0,BDA1) end;
into method label GBTI code_regex \(BCR, replaceall_matched begin (B1B2(CR0,CR1), end;
into method label GBTI code_regex \(BRTE, replaceall_matched begin (B1B2(RTE0,RTE1), end;
into method label GBTI code_regex \(BATE, replaceall_matched begin (B1B2(ATE0,ATE1), end;
into method label GBTI code_regex \(BATF, replaceall_matched begin (B1B2(ATF0,ATF1), end;
into method label GBTC code_regex \(MAXC, replaceall_matched begin (B1B2(AXC0,AXC1), end;
into method label SBTC code_regex MAXC\) replaceall_matched begin B1B2(AXC0,AXC1)) end;
into method label GCGC code_regex \(\\\_SB\.PCI0\.LPCB\.EC0\.BPR, replaceall_matched begin (B1B2(\\_SB.PCI0.LPCB.EC0.BPR0,\\_SB.PCI0.LPCB.EC0.BPR1), end;

EDIT: patch currently has a bug where the "estimated time remaining" isn't calculated and you get somewhat frequent "low battery" warnings. Charge % seems to be accurate though and it's just mildlly annoying. I'll update this when I find a fix.
EDIT 2: the above issue was caused by having EC0 -> EC patch on Clover. Disabling it and using SSDT-EC seems to have fixed it.
EDIT 3: It wasn't actually fixed (though the warnings seem less frequent). I'll investigate further.
 
Last edited:
Joined
Jun 9, 2019
Messages
3
Motherboard
HP OMEN 15 ce0xx / CLOVER
CPU
i7-7700HQ / HM175
Graphics
HD 630 / GTX 1050
Mobile Phone
  1. Android
Hi, i need help with power management:

I have HP Omen 15 ce0xx
i7-7700HQ
HM175
HD630/ GTX1050

MacOS seems to mess up my battery. Its working ok on win10 but if I boot macOS it can charge upto 100%. But when I unplug it and let it discharge, it won't charge again. When I boot up win10, it won't charge as well unless I do a CMOS reset. I am using HP-DV6-3165sf patch as per this guide: https://www.tonymacx86.com/attachments/omen15_hackintosh-pdf.322288/.

ACPIBatteryManager.kext in /L/E..
BIOS updated to F.19

I tried adding the disable Nvidia part on the patch as per guide but it results in error when compiling. Also, I cannot boot with other clover versions other than Rehabman's. I have no background in programming/coding. Tried reading RM's guide for patching battery several times but it seems I don't have the capacity to understand it :banghead:

@GffMaC help please?

Thanks in advance!

edit: Was able to do the Nvidia disable patch as per guide. Just had to manually type it in. Copy paste somehow resulted in error. Still getting the battery problem.
 
Last edited:
Joined
Feb 4, 2016
Messages
1
Motherboard
macbook pro 2011
CPU
i7
Graphics
intel + ati
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
I need help, I have an laptop asus model N61VN , I tried to patch the DSDT to see the battery charge, I used the two patches available for asus laptop and none works.

I am desperate, I have tried to install voodoo battery but it breaks my system and I have to install everything again.

I attach my original DSDT

Can someone please help me.

Thanks in advance.
 

Attachments

  • DSDT.aml
    49.6 KB · Views: 77
Top