Jump to content
onemanosx

[Guide] Laptop Battery Indicator - The DSDT Patching Horror

Recommended Posts

I think I need my DSDT updated again lol, I have an HP Envy 17-u163cl, macOS 10.15.5. The zip was too big than the allowed size, so here is the google drive link. Thank you!

https://drive.google.com/file/d/1K1Qvxd03FrUIvIbpEbRtsBlWzx_yCvkG/view?usp=sharing

EDIT: Everything pretty much works except for HDMI (it also panics when removing/reinserting an HDMI cable), the SD Card reader, and the battery indicator. Brightness key mapping are not a big priority because I can edit that in Settings. Not sure about the USB-C port either.

 

Edited by Dave1482
Link to comment
Share on other sites

Hey guys, I cant figure this out for my Matebook X Pro 2020. Followed the guide, but RefOf in my DSDT doesnt seem to be compatible with B1B2. What can I do?

 

into device label HWEC code_regex B0VL,\s+16 replace_matched begin VL00,8,VL01,8 end;
into device label HWEC code_regex B0RC,\s+16 replace_matched begin RC00,8,RC01,8 end;
into device label HWEC code_regex B0ST,\s+16 replace_matched begin ST00,8,ST01,8 end;
into device label HWEC code_regex B0CC,\s+16 replace_matched begin CC00,8,CC01,8 end;
into device label HWEC code_regex B0FC,\s+16 replace_matched begin FC00,8,FC01,8 end;
into device label HWEC code_regex B0DC,\s+16 replace_matched begin DC00,8,DC01,8 end;
into device label HWEC code_regex B0DV,\s+16 replace_matched begin DV00,8,DV01,8 end;
into device label HWEC code_regex B0CT,\s+16 replace_matched begin CT00,8,CT01,8 end;
into device label HWEC code_regex B0SN,\s+16 replace_matched begin SN00,8,SN01,8 end;
into device label HWEC code_regex EKVA,\s+16 replace_matched begin KVA0,8,KVA1,8 end;
into device label HWEC code_regex EULV,\s+16 replace_matched begin ULV0,8,ULV1,8 end;
into device label HWEC code_regex ELLV,\s+16 replace_matched begin LLV0,8,LLV1,8 end;
into device label HWEC code_regex CALS,\s+16 replace_matched begin ALS0,8,ALS1,8 end;
into device label HWEC code_regex ELUX,\s+16 replace_matched begin LUX0,8,LUX1,8 end;
B0VL -> B1B2(VL00,VL01)
B0RC -> B1B2(RC00,RC01)
B0ST -> B1B2(ST00,ST01)
B0CC -> B1B2(CC00,CC01)
B0FC -> B1B2(FC00,FC01)
B0DC -> B1B2(DC00,DC01)
B0DV -> B1B2(DV00,DV01)
B0CT -> B1B2(CT00,CT01)
B0SN -> B1B2(SN00,SN01)
EKVA -> B1B2(KVA0,KVA1)
EULV -> B1B2(ULV0,ULV1)
ELLV -> B1B2(LLV0,LLV1)
CALS -> B1B2(ALS0,ALS1)
ELUX -> B1B2(LUX0,LUX1)

 

Error for each reference:

50994, 6126, syntax error, unexpected PARSEOP_CLOSE_PAREN, expecting PARSEOP_EXP_INDEX_LEFT

 

Bildschirmfoto-2020-07-18-um-22-46-32.pn

DSDT.aml

Edited by Killuminati91
Link to comment
Share on other sites

On 4/3/2020 at 7:03 PM, MaLd0n said:

first post

This is My patch and my SSDT-2, i dont understand why the red parts can't work....

With Mojave this patch was perfect...there is a must way to indicate INTO METHOD LABEL??

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

into scope label \_SB.PCI0.LPCB.H_EC code_regex BA1T,\s+16, replace_matched begin B1T0,8, B1T1,8, end;
into scope label \_SB.PCI0.LPCB.H_EC code_regex BA2T,\s+16, replace_matched begin B2T0,8, B2T1,8, end;
into scope label \_SB.PCI0.LPCB.H_EC code_regex BA3T,\s+16, replace_matched begin B3T0,8, B3T1,8, end;
into scope label \_SB.PCI0.LPCB.H_EC code_regex BA4T,\s+16, replace_matched begin B4T0,8, B4T1,8, end;
into scope label \_SB.PCI0.LPCB.H_EC code_regex BA5T,\s+16, replace_matched begin B5T0,8, B5T1,8, end;
into scope label \_SB.PCI0.LPCB.H_EC code_regex BA6T,\s+16, replace_matched begin B6T0,8, B6T1,8, end;

into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA1T\)\), replaceall_matched begin B1B2(B1T0,B1T1), end;
into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA2T\)\), replaceall_matched begin B1B2(B2T0,B2T1), end;
into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA3T\)\), replaceall_matched begin B1B2(B3T0,B3T1), end;
into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA4T\)\), replaceall_matched begin B1B2(B4T0,B4T1), end;
into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA5T\)\), replaceall_matched begin B1B2(B5T0,B5T1), end;
into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA6T\)\), replaceall_matched begin B1B2(B6T0,B6T1), end;

into method label _BST code_regex ECR2\s+\(RefOf\s+\(BA1T\)\), replaceall_matched begin B1B2(B1T0,B1T1), end;
into method label _BST code_regex ECR2\s+\(RefOf\s+\(BA2T\)\), replaceall_matched begin B1B2(B2T0,B2T1), end;
into method label _BST code_regex ECR2\s+\(RefOf\s+\(BA3T\)\), replaceall_matched begin B1B2(B3T0,B3T1), end;
into method label _BST code_regex ECR2\s+\(RefOf\s+\(BA5T\)\), replaceall_matched begin B1B2(B5T0,B5T1), end;

# utility methods to read/write buffers from/to EC by RehabMan
into method label RE1B parent_label \_SB.PCI0.LPCB.H_EC remove_entry;
into method label RECB parent_label \_SB.PCI0.LPCB.H_EC remove_entry;
into scope label \_SB.PCI0.LPCB.H_EC insert
begin
Method (RE1B, 1, NotSerialized)\n
{\n
    OperationRegion(ERAM, EmbeddedControl, Arg0, 1)\n
    Field(ERAM, ByteAcc, NoLock, Preserve) { BYTE, 8 }\n
    Return(BYTE)\n
}\n
Method (RECB, 2, Serialized)\n
{\n
    ShiftRight(Arg1, 3, Arg1)\n
    Name(TEMP, Buffer(Arg1) { })\n
    Add(Arg0, Arg1, Arg1)\n
    Store(0, Local0)\n
    While (LLess(Arg0, Arg1))\n
    {\n
        Store(RE1B(Arg0), Index(TEMP, Local0))\n
        Increment(Arg0)\n
        Increment(Local0)\n
    }\n
    Return(TEMP)\n
}\n
end;

# patch 256 bit SMBD register (fixes by RehabMan)
into scope label \_SB.PCI0.LPCB.H_EC code_regex (SMBD,)\s+(256) replace_matched begin SMBX,%2,//%1%2 end;
into method label SMBR code_regex \(SMBD, replaceall_matched begin (RECB(0x44,256), end;

#EOF

SSDT-2.aml

Link to comment
Share on other sites

  • Administrators

use rehabman maciasl version for apply that

-Donations-

PayPal HERE - Stripe HERE - Ko-Fi HERE - BuyMeaCoffee HERE - Mercado Livre HERE

Skrill danielnmaldonado@gmail.com - BTC 33HeGCuCSh4tUBqdYkQqKpSDa1E7WeAJQ3 - BNB 0x10D1d656eCa00bD521f9b4A43B83098B8142e115 - USDT BSC BEP20 0xb57cfdfa371fad1981910f0e8332409ab99f74d9 - USDT TRC20 TUR6Z9AVS4AYzqPnULoHrfFvppRbhXmNbZ - KASPA kaspa:qpxzufgfj8p6r0krg58yzvs0009h2mwqgvcawa0xc2pth7sgzpv56j4f6dtvk - PicPay @danielnmaldonado - PiX @danielnmaldonado@gmail.com

Premium Users HERE - Problems with Paypal HERE

xcd5u2Y.png

Sign up for a Bybit account and claim exclusive rewards HERE

New ways to earn money with Linkvertise HERE

Link to comment
Share on other sites

same problem

 

I have to figure out how to indicate the _BIF method and _BST 

MaciASL recognizes the patch but doesn't know where to apply it, any suggestions?

 

into method label _BIF code_regex ECR2\s+\(RefOf\s+\(BA1T\)\), replaceall_matched begin B1B2(B1T0,B1T1), end;

into method label _BST code_regex ECR2\s+\(RefOf\s+\(BA1T\)\), replaceall_matched begin B1B2(B1T0,B1T1), end;

 

Edited by R-88
Link to comment
Share on other sites

  • Administrators

Bro, battery patch u need loose some hours on that if ur patch is missing in rehabman repo

u need pay attention in embedded controller device too, if u use ec0 to ec for example, u need change it in patch too before apply

-Donations-

PayPal HERE - Stripe HERE - Ko-Fi HERE - BuyMeaCoffee HERE - Mercado Livre HERE

Skrill danielnmaldonado@gmail.com - BTC 33HeGCuCSh4tUBqdYkQqKpSDa1E7WeAJQ3 - BNB 0x10D1d656eCa00bD521f9b4A43B83098B8142e115 - USDT BSC BEP20 0xb57cfdfa371fad1981910f0e8332409ab99f74d9 - USDT TRC20 TUR6Z9AVS4AYzqPnULoHrfFvppRbhXmNbZ - KASPA kaspa:qpxzufgfj8p6r0krg58yzvs0009h2mwqgvcawa0xc2pth7sgzpv56j4f6dtvk - PicPay @danielnmaldonado - PiX @danielnmaldonado@gmail.com

Premium Users HERE - Problems with Paypal HERE

xcd5u2Y.png

Sign up for a Bybit account and claim exclusive rewards HERE

New ways to earn money with Linkvertise HERE

Link to comment
Share on other sites

31 minutes ago, MaLd0n said:

Bro, battery patch u need loose some hours on that if ur patch is missing in rehabman repo

u need pay attention in embedded controller device too, if u use ec0 to ec for example, u need change it in patch too before apply

I’ve wrote my patch by myself. It is in the rehab repository but can’t work on opencore. My original patch was made for ssdt1. Now with opencore I’ve extracted new ACPI and I have find the embedded on ssdt2. 
This is not clear, why it is changed??

my dsdt and ssdt work on clover but not on opencore. Why??

Link to comment
Share on other sites

  • Administrators
Just now, R-88 said:

my dsdt and ssdt work on clover but not on opencore. Why??

the best is patch in Opencore and work in opencore/clover

opencore is new, need many improvements about things

-Donations-

PayPal HERE - Stripe HERE - Ko-Fi HERE - BuyMeaCoffee HERE - Mercado Livre HERE

Skrill danielnmaldonado@gmail.com - BTC 33HeGCuCSh4tUBqdYkQqKpSDa1E7WeAJQ3 - BNB 0x10D1d656eCa00bD521f9b4A43B83098B8142e115 - USDT BSC BEP20 0xb57cfdfa371fad1981910f0e8332409ab99f74d9 - USDT TRC20 TUR6Z9AVS4AYzqPnULoHrfFvppRbhXmNbZ - KASPA kaspa:qpxzufgfj8p6r0krg58yzvs0009h2mwqgvcawa0xc2pth7sgzpv56j4f6dtvk - PicPay @danielnmaldonado - PiX @danielnmaldonado@gmail.com

Premium Users HERE - Problems with Paypal HERE

xcd5u2Y.png

Sign up for a Bybit account and claim exclusive rewards HERE

New ways to earn money with Linkvertise HERE

Link to comment
Share on other sites

13 minutes ago, MaLd0n said:

the best is patch in Opencore and work in opencore/clover

opencore is new, need many improvements about things

Ok so now I use opencore I will send you a new runme and a will work on a new dsdt

Edited by R-88
Link to comment
Share on other sites

6 hours ago, MaLd0n said:

the best is patch in Opencore and work in opencore/clover

opencore is new, need many improvements about things

ok opencore work, we fix first the dsdt and after i will fix the battery

please consider i have my usbPort.kext

i've extract all necessary

http://gofile.me/6EH67/4N0YZgkUq

http://gofile.me/6EH67/bD2YRxH8T

 

Edited by R-88
Link to comment
Share on other sites

  • Administrators
3 hours ago, R-88 said:

ok opencore work, we fix first the dsdt and after i will fix the battery

DSDT.aml.zip

-Donations-

PayPal HERE - Stripe HERE - Ko-Fi HERE - BuyMeaCoffee HERE - Mercado Livre HERE

Skrill danielnmaldonado@gmail.com - BTC 33HeGCuCSh4tUBqdYkQqKpSDa1E7WeAJQ3 - BNB 0x10D1d656eCa00bD521f9b4A43B83098B8142e115 - USDT BSC BEP20 0xb57cfdfa371fad1981910f0e8332409ab99f74d9 - USDT TRC20 TUR6Z9AVS4AYzqPnULoHrfFvppRbhXmNbZ - KASPA kaspa:qpxzufgfj8p6r0krg58yzvs0009h2mwqgvcawa0xc2pth7sgzpv56j4f6dtvk - PicPay @danielnmaldonado - PiX @danielnmaldonado@gmail.com

Premium Users HERE - Problems with Paypal HERE

xcd5u2Y.png

Sign up for a Bybit account and claim exclusive rewards HERE

New ways to earn money with Linkvertise HERE

Link to comment
Share on other sites

On 8/29/2020 at 3:34 AM, MaLd0n said:

There are ACPI errors
1. You have changed H_EC to EC, this does not allow my battery patch to work
2. My battery patch applies to the SSDT-2, not the DSDT
3. Using Clover my patch worked together with your DSDT, why doesn't it work with Opencore?
4. I have included the SysReport with native DSDT and SSDT extracted with Opencore and new SendMe

http://gofile.me/6EH67/BpyStCARz

 

Link to comment
Share on other sites

  • Administrators
1 hour ago, R-88 said:

Using Clover my patch worked together with your DSDT, why doesn't it work with Opencore?

Opencore don't override secondary tables automatic like clover

clover identify table and override. we dont need made any change for that. opencore no. u need drop OEM table in config.plist and add ur new table

-Donations-

PayPal HERE - Stripe HERE - Ko-Fi HERE - BuyMeaCoffee HERE - Mercado Livre HERE

Skrill danielnmaldonado@gmail.com - BTC 33HeGCuCSh4tUBqdYkQqKpSDa1E7WeAJQ3 - BNB 0x10D1d656eCa00bD521f9b4A43B83098B8142e115 - USDT BSC BEP20 0xb57cfdfa371fad1981910f0e8332409ab99f74d9 - USDT TRC20 TUR6Z9AVS4AYzqPnULoHrfFvppRbhXmNbZ - KASPA kaspa:qpxzufgfj8p6r0krg58yzvs0009h2mwqgvcawa0xc2pth7sgzpv56j4f6dtvk - PicPay @danielnmaldonado - PiX @danielnmaldonado@gmail.com

Premium Users HERE - Problems with Paypal HERE

xcd5u2Y.png

Sign up for a Bybit account and claim exclusive rewards HERE

New ways to earn money with Linkvertise HERE

Link to comment
Share on other sites

u need drop OEM table in config.plist and add ur new table

 

Thanx for the reply!!!

But is not clear. In my old Clover config i can't have any table OEM selected...

I attach the old EFI Clover and the New EFI Opencore, i don't understand what you tell me to do, sorry...

http://gofile.me/6EH67/qGR1IJyjB

http://gofile.me/6EH67/vPhXFmqpj

 

!!! IN THE PREVIOUS DSDT MADE BY YOU I HAVE H_EC NOT EC, also in all my SSDT I HAVE H_EC, 
in fact if I don't change H_EC in EC in the SSDT-1 the battery is not detected. Can't you leave H_EC on DSDT and I patch H_EC to EC ??

Send me MacBook-Pro-2.home-life.hub.zip

Edited by R-88
Link to comment
Share on other sites

  • Administrators

u need remove this rename, use ssdt olarila, reboot and extract new

 

10 hours ago, R-88 said:

But is not clear. In my old Clover config i can't have any table OEM selected

Clover is a complete bootloader with all solutions. Opencore is new and need many improvements for advanced users

-Donations-

PayPal HERE - Stripe HERE - Ko-Fi HERE - BuyMeaCoffee HERE - Mercado Livre HERE

Skrill danielnmaldonado@gmail.com - BTC 33HeGCuCSh4tUBqdYkQqKpSDa1E7WeAJQ3 - BNB 0x10D1d656eCa00bD521f9b4A43B83098B8142e115 - USDT BSC BEP20 0xb57cfdfa371fad1981910f0e8332409ab99f74d9 - USDT TRC20 TUR6Z9AVS4AYzqPnULoHrfFvppRbhXmNbZ - KASPA kaspa:qpxzufgfj8p6r0krg58yzvs0009h2mwqgvcawa0xc2pth7sgzpv56j4f6dtvk - PicPay @danielnmaldonado - PiX @danielnmaldonado@gmail.com

Premium Users HERE - Problems with Paypal HERE

xcd5u2Y.png

Sign up for a Bybit account and claim exclusive rewards HERE

New ways to earn money with Linkvertise HERE

Link to comment
Share on other sites

  • Administrators
4 hours ago, R-88 said:

here it is!!

DSDT.aml.zip

-Donations-

PayPal HERE - Stripe HERE - Ko-Fi HERE - BuyMeaCoffee HERE - Mercado Livre HERE

Skrill danielnmaldonado@gmail.com - BTC 33HeGCuCSh4tUBqdYkQqKpSDa1E7WeAJQ3 - BNB 0x10D1d656eCa00bD521f9b4A43B83098B8142e115 - USDT BSC BEP20 0xb57cfdfa371fad1981910f0e8332409ab99f74d9 - USDT TRC20 TUR6Z9AVS4AYzqPnULoHrfFvppRbhXmNbZ - KASPA kaspa:qpxzufgfj8p6r0krg58yzvs0009h2mwqgvcawa0xc2pth7sgzpv56j4f6dtvk - PicPay @danielnmaldonado - PiX @danielnmaldonado@gmail.com

Premium Users HERE - Problems with Paypal HERE

xcd5u2Y.png

Sign up for a Bybit account and claim exclusive rewards HERE

New ways to earn money with Linkvertise HERE

Link to comment
Share on other sites

 

2 hours ago, MaLd0n said:

You are the best!
As you can see now that H_EC exists my battery works and also see the power adapter!
There are some ACPI errors that I don't understand how to fix them...
I attach a new send me, consider that I am using OC Debug
let me know

 

P.S. Can't power off but reboot

Send me MacBook-Pro-2.zip Picture.png.zip

Edited by R-88
Link to comment
Share on other sites

  • Administrators

looks good

ignore acpi warnings. is about battery

-Donations-

PayPal HERE - Stripe HERE - Ko-Fi HERE - BuyMeaCoffee HERE - Mercado Livre HERE

Skrill danielnmaldonado@gmail.com - BTC 33HeGCuCSh4tUBqdYkQqKpSDa1E7WeAJQ3 - BNB 0x10D1d656eCa00bD521f9b4A43B83098B8142e115 - USDT BSC BEP20 0xb57cfdfa371fad1981910f0e8332409ab99f74d9 - USDT TRC20 TUR6Z9AVS4AYzqPnULoHrfFvppRbhXmNbZ - KASPA kaspa:qpxzufgfj8p6r0krg58yzvs0009h2mwqgvcawa0xc2pth7sgzpv56j4f6dtvk - PicPay @danielnmaldonado - PiX @danielnmaldonado@gmail.com

Premium Users HERE - Problems with Paypal HERE

xcd5u2Y.png

Sign up for a Bybit account and claim exclusive rewards HERE

New ways to earn money with Linkvertise HERE

Link to comment
Share on other sites

  • Administrators
40 minutes ago, fabioad said:

Model: Avell High Performance 1513 (0% Battery problem)

DSDT.aml.zip

-Donations-

PayPal HERE - Stripe HERE - Ko-Fi HERE - BuyMeaCoffee HERE - Mercado Livre HERE

Skrill danielnmaldonado@gmail.com - BTC 33HeGCuCSh4tUBqdYkQqKpSDa1E7WeAJQ3 - BNB 0x10D1d656eCa00bD521f9b4A43B83098B8142e115 - USDT BSC BEP20 0xb57cfdfa371fad1981910f0e8332409ab99f74d9 - USDT TRC20 TUR6Z9AVS4AYzqPnULoHrfFvppRbhXmNbZ - KASPA kaspa:qpxzufgfj8p6r0krg58yzvs0009h2mwqgvcawa0xc2pth7sgzpv56j4f6dtvk - PicPay @danielnmaldonado - PiX @danielnmaldonado@gmail.com

Premium Users HERE - Problems with Paypal HERE

xcd5u2Y.png

Sign up for a Bybit account and claim exclusive rewards HERE

New ways to earn money with Linkvertise HERE

Link to comment
Share on other sites

Greetings, my problem is the following: before I had my build in high sierra with clover and it used the rehabmab battery_WBIN-Airbook patch that was compatible with my battery and it worked fine but now I did a new installation with opencore catalina, I apply the same patch to the ssdt and the battery status no longer shows, I also patched my dsdt following the rehab guide and nothing. Somebody could help me? my laptop is a compaq presaria 21-N2F5AR.
I used virtualmsc and fakemsc with their respective kexts for drums and neither of them worked.

My zip with EFI folder. https://drive.google.com/file/d/10iCfAWQn192CXBQAEhGBhB0AsX5c_X1B/view?usp=sharing

Edited by ndeni
Link to comment
Share on other sites

  • Administrators

use virtualsmc with battery plugin instead

-Donations-

PayPal HERE - Stripe HERE - Ko-Fi HERE - BuyMeaCoffee HERE - Mercado Livre HERE

Skrill danielnmaldonado@gmail.com - BTC 33HeGCuCSh4tUBqdYkQqKpSDa1E7WeAJQ3 - BNB 0x10D1d656eCa00bD521f9b4A43B83098B8142e115 - USDT BSC BEP20 0xb57cfdfa371fad1981910f0e8332409ab99f74d9 - USDT TRC20 TUR6Z9AVS4AYzqPnULoHrfFvppRbhXmNbZ - KASPA kaspa:qpxzufgfj8p6r0krg58yzvs0009h2mwqgvcawa0xc2pth7sgzpv56j4f6dtvk - PicPay @danielnmaldonado - PiX @danielnmaldonado@gmail.com

Premium Users HERE - Problems with Paypal HERE

xcd5u2Y.png

Sign up for a Bybit account and claim exclusive rewards HERE

New ways to earn money with Linkvertise HERE

Link to comment
Share on other sites

4 hours ago, MaLd0n said:

use virtualsmc with battery plugin instead

Hi MaLd0n, yes, I tried both. With virtualSMC with battery plugin and with fakeSMC but neither of them worked for me. From what I see I have a machine similar to R-88 that I wrote above because the patch that works with my battery is the same one that he uses. But it doesn't work anyway. Could you take a look at my DSDT and see if there is something wrong? I would greatly appreciate it. As I value your work, I can donate you some Bitcoin if you solve it for me. thank you very much!

Edited by ndeni
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.





×
  • Create New...