Contribute
Register

[Guide] How to patch DSDT for working battery status

Joined
Oct 26, 2017
Messages
33
Motherboard
Zbook 15
CPU
i7 4600M Haswell QM87
Graphics
HD4600 + NVIDIA Quadro K1100M, 1920x1080
Mobile Phone
  1. Android
Hi, i am new user for OpenCore and i would like to manage battery lever. I do not have all skills for change DSDT.aml by myself.

I check the rehabman repertory for a patch (HP 820 G3) without succes.

someone can help me ? I attach original DSDT extract with clover start from usb key
Finally after some time and efforts i do an working dsdt
 

Attachments

  • DSDT-840G3.aml
    153.6 KB · Views: 43
Joined
May 23, 2019
Messages
2
Motherboard
ASrock Z370 miniITX
CPU
i7-3632QM
Graphics
Intel HD4000
Hello,

I'm having a problem where patching my system DSDT with Rehabman's laptop DSDT battery patch: battery_lenovo_E440.txt.

The patch is said to support Lenovo E531 laptops. However, patching and compiling my DSDT using this battery patch results in 8 of the same errors:

"Object does not exist (\_SB.PCI0.LPCB.EC0.HWAK)".

I'm stuck and I can't figure out why this is happening. (Unfortunately, I'm not a programmer). I would really appreciate some help with getting my battery to work. I've uploaded a copy of my system DSDT and Rehabman's battery patch is found here:


Thank you in advance!
 
Last edited:
Joined
May 23, 2019
Messages
2
Motherboard
ASrock Z370 miniITX
CPU
i7-3632QM
Graphics
Intel HD4000
Hello,

I'm having a problem where patching my system DSDT with Rehabman's laptop DSDT battery patch: battery_lenovo_E440.txt.

The patch is said to support Lenovo E531 laptops. However, patching and compiling my DSDT using this battery patch results in 8 of the same errors:

"Object does not exist (\_SB.PCI0.LPCB.EC0.HWAK)".

I'm stuck and I can't figure out why this is happening. (Unfortunately, I'm not a programmer). I would really appreciate some help with getting my battery to work. I've uploaded a copy of my system DSDT and Rehabman's battery patch is found here:


Thank you in advance!
Fixed myself. Patching with Rehabman's version MaciASL does the job. Weirdly Opencore suggest against this.
 
Joined
Nov 21, 2017
Messages
19
Motherboard
MSI Z370 GAMING PLUS
CPU
i5-8400
Graphics
R7 265
Finally got my Lenovo-P53 installed so just doing some post install stuff. Having a time with finding info on patching my batter indicator. Not sure what battery_txtfile would even come close to being compatible. Any ideas?

Joe W
 
Joined
Mar 25, 2020
Messages
7
Motherboard
Lenovo 20HHCTO1WW
CPU
Intel Core i7-7820HQ
Graphics
Intel HD Graphics 630 & NVIDIA Quadro M1200
I'm running into a problem with the B1B2 method patch.

When I do this patch:
into method label B1B2 remove_entry;
into definitionblock code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;
The method goes into Scope (\_SB.PCI0.LPCB). This means that when I try to go forward with patching 16-bit HWAC, I cant use B1B2 where HWAC is referenced outside of this scope (the problem areas are in scope _GPE and method OWAK).

I tried to add B1B2 to these places too with
into scope label code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;
and
into method label OWAK code_regex . insert
begin
Method (B1B2, 2, NotSerialized) { Return(Or(Arg0, ShiftLeft(Arg1, 8))) }\n
end;
but it produced a compile error Illegal Forward Reference for the method OWAK patch (is there maybe a way to prepend patches?).

I figured out a workaround by manually editing the file and just pasting the B1B2 method at the end of the file (I saw this is where it was on successfully patched DSDTs). But would appreciate any insight into why the patching isn't working for me as expected.

Thanks!
 

Attachments

  • DSDT.aml
    124.7 KB · Views: 14
  • DSDTpatching.aml
    124.7 KB · Views: 16
Last edited:
Joined
Feb 8, 2013
Messages
96
Motherboard
GA-H270N-Wifi
CPU
i7-7700K
Graphics
GTX 1070
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
Say when I have something like:

Code:
Scope (_SB.PCI0.LPCB)
{
    Device (EC0)
    {
        Field (SMBX, ByteAcc, NoLock, Preserve)
        {
            Offset (0x04), 
            DAT0,   8, 
            DAT1,   8
         }
    }
}

Scope (_SB.PCI0.LPCB.EC0)
{
   	Method (ECSB, 7, NotSerialized)
    {
		Local1 [One] = DAT0 /* \_SB_.PCI0.LPCB.EC0_.DAT0 */
        Local1 [0x02] = DAT1 /* \_SB_.PCI0.LPCB.EC0_.DAT1 */
	}
}

then how to I access that friggin DAT0 or DAT1 field?

Is it

Code:
External (_SB.PCI0.LPCB.EC0.DAT0)

or

External (_SB.PCI0.LPCB.EC0.SMBX.DAT0)

That cant be right? Where is the SMBX?
 
Joined
Apr 13, 2017
Messages
4
Motherboard
Lenovo Thinkpad P53
CPU
Core i7 9850-H
Graphics
Nvidia Quadro T1000
Mobile Phone
  1. iOS
Finally got my Lenovo-P53 installed so just doing some post install stuff. Having a time with finding info on patching my batter indicator. Not sure what battery_txtfile would even come close to being compatible. Any ideas?

Joe W
Did you ever find a good one to use for it? I'm just got my hackintosh setup on my P53 and most things are working except the battery now, I tried using the Lenovo X230i one as it mentions support for the P50 and P51 at the top of the file, but I had no luck as this sort of patching seems out of my skill range.
 
Joined
Jan 11, 2021
Messages
24
Motherboard
Apollo Entroware - H20 Bios
CPU
I7-8565U
Graphics
Intel UHD 620
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
Hello all, need some help with my hackintosh battery. I have pretty much everything working on Big Sur except the battery which I am getting the notification for but it is not accurate nor do I get a symbol for charging either. I have put all my files on github including my DSDT dump. Any help would be great because I cannot use the laptop much without the power cable.

 
Joined
Jan 14, 2021
Messages
1
Motherboard
B450 Tomahawk Max
CPU
Ryzen 7 3700x
Graphics
RX 5700 XT
Is it

Code:
External (_SB.PCI0.LPCB.EC0.DAT0)

or

External (_SB.PCI0.LPCB.EC0.SMBX.DAT0)

That cant be right? Where is the SMBX?
You access it like this:

Code:
External (_SB_.PCI0.LPCB.EC0.DAT0, FieldUnitObj)
 
Last edited:
Joined
Feb 9, 2021
Messages
2
Motherboard
HP 827D
CPU
Intel Core i5-7300U
Graphics
Intel HD 620
Mobile Phone
  1. iOS
Hey Guys,

I have an HP EliteBook x360 1030 G2.

I've managed to get Catalina 10.15 installed with pretty much everything working (GFX, Audio, Mic, Webcam, Intel WiFi, USB ports).

All I am missing is the DSDT for Battery and RTC Bios error (which I will tackle last; given it looks fairly simple).

What I need some help on is the DSDT Patching for the Battery.

I used the HP x360 patch and also tried the Folio 13 patch but both of them keep showing the same sets of errors when compiling:


21359, 6126, syntax error, unexpected PARSEOP_IF, expecting PARSEOP_CLOSE_PAREN or ','
21362, 6126, syntax error, unexpected ','
21362, 6126, syntax error, unexpected PARSEOP_CLOSE_PAREN
21453, 6126, syntax error, unexpected PARSEOP_SCOPE, expecting $end and premature End-Of-File


It seems like its just syntax errors but when trying to fix them, it just ends up creating a mess.

I have attached my DSDT.dsl for reference if someone feels like they want to help a brother out :)

Thanks in advanced!
 

Attachments

  • DSDT.dsl
    993.9 KB · Views: 8
Last edited:
Top