Contribute
Register

[Guide] How to patch DSDT for working battery status

Is that right?
#Convert 24 bit to 8 bit registers

into device label EC code_regex XFNW,\s+24, replace_matched

begin

XFNA,8,XFNB,8,XFNC,8,\n

end;



# fix 24-bit methods

into method label WMBD code_regex Return\s+\(\^\^LPCB.EC.XFNW\) replaceall_matched begin Return (B1B4(^^LPCB.EC.XFNA, ^^LPCB.EC.XFNB, ^^LPCB.EC.XFNC, 0)) end;



#Write

into method label WMBD code_regex Store\s\((.*),\s\^\^LPCB.EC.XFNW\) replaceall_matched

begin

^^LPCB.EC.XFNA = Arg2\n

^^LPCB.EC.XFNB = Arg2 >> 8\n

^^LPCB.EC.XFNC = Arg2 >> 16\n

end;


Then:
Case (0x68)

{

Store (0x69, DBG8)

Store (Arg2, ^^LPCB.EC.XFNW)

Return (^^LPCB.EC.XFNW)

}

to:

Case (0x68)

{

Store (0x69, DBG8)

^^LPCB.EC.XFNA = Arg2

^^LPCB.EC.XFNB = Arg2 >> 8

^^LPCB.EC.XFNC = Arg2 >> 16

Return (B1B4(^^LPCB.EC.XFNA, ^^LPCB.EC.XFNB, ^^LPCB.EC.XFNC, 0))

}

You need to test your code to determine whether it is correct or not.
 
Can anyone nudge me into the right direction?

Lenovo T470s
Intel HD 620

I am trying to patch DSDT.dsl and (prior to apply any patch), I have some compilation errors, all of them related to PARSEOP_*
No PARSEOP patch can be applied because the Apply button is greyed out and the Before/After zone is empty.

- files extracted from Clover (F4)
- iasl shows:
Code:
Intel ACPI Component Architecture

ASL+ Optimizing Compiler version 20161210-64(RM)

Copyright (c) 2000 - 2016 Intel Corporation

Supports ACPI Specification Revision 6.1
- refs.txt as in original post:
Code:
External(MDBG, MethodObj, 1)
External(_GPE.MMTB, MethodObj, 0)
External(_SB.PCI0.LPCB.H_EC.ECWT, MethodObj, 2)
External(_SB.PCI0.LPCB.H_EC.ECRD, MethodObj, 1)
External(_SB.PCI0.LPCB.H_EC.ECMD, MethodObj, 1)
External(_SB.PCI0.PEG0.PEGP.SGPO, MethodObj, 2)
External(_SB.PCI0.GFX0.DD02._BCM, MethodObj, 1)
External(_SB.PCI0.SAT0.SDSM, MethodObj, 4)
External(_GPE.VHOV, MethodObj, 3)
External(_SB.PCI0.XHC.RHUB.TPLD, MethodObj, 2)
- files decompiled with:
Code:
iasl -da -dl -fe refs.txt DSDT.aml SSDT*.aml

- looks like there are no duplicate files after decompilation

- MaciASL set to ACPI 6.1

Thank you.
 

Attachments

  • origin.zip
    172.6 KB · Views: 65
  • Screen Shot 2017-11-19 at 17.53.08.png
    Screen Shot 2017-11-19 at 17.53.08.png
    60 KB · Views: 89
Can anyone nudge me into the right direction?

Lenovo T470s
Intel HD 620

I am trying to patch DSDT.dsl and (prior to apply any patch), I have some compilation errors, all of them related to PARSEOP_*
No PARSEOP patch can be applied because the Apply button is greyed out and the Before/After zone is empty.

- files extracted from Clover (F4)
- iasl shows:
Code:
Intel ACPI Component Architecture

ASL+ Optimizing Compiler version 20161210-64(RM)

Copyright (c) 2000 - 2016 Intel Corporation

Supports ACPI Specification Revision 6.1
- refs.txt as in original post:
Code:
External(MDBG, MethodObj, 1)
External(_GPE.MMTB, MethodObj, 0)
External(_SB.PCI0.LPCB.H_EC.ECWT, MethodObj, 2)
External(_SB.PCI0.LPCB.H_EC.ECRD, MethodObj, 1)
External(_SB.PCI0.LPCB.H_EC.ECMD, MethodObj, 1)
External(_SB.PCI0.PEG0.PEGP.SGPO, MethodObj, 2)
External(_SB.PCI0.GFX0.DD02._BCM, MethodObj, 1)
External(_SB.PCI0.SAT0.SDSM, MethodObj, 4)
External(_GPE.VHOV, MethodObj, 3)
External(_SB.PCI0.XHC.RHUB.TPLD, MethodObj, 2)
- files decompiled with:
Code:
iasl -da -dl -fe refs.txt DSDT.aml SSDT*.aml

- looks like there are no duplicate files after decompilation

- MaciASL set to ACPI 6.1

Thank you.

No need for refs.txt in your case. Your ACPI files have embedded External opcodes.
 
Thank you, now just an error left (I have commented the line). Will report back.

Make sure you comment the correct line. If you commented the line at the error, you made the wrong choice (eg. need to comment or remove the extraneous 'External' line instead)
 
Your ioreg shows battery status working.
What is the issue?
But kexts are not installed correctly.
See post #2 of the guide:
https://www.tonymacx86.com/threads/guide-booting-the-os-x-installer-on-laptops-with-clover.148093/

Also, did you read here?
https://www.tonymacx86.com/threads/readme-common-problems-in-10-13-high-sierra.233582/

oh yeah, do you mean kext that I included on clover? now I move it to /Library/Extensions.
the battery status is not showed. 'show battery status on status bar' option on syspref can't be activated.

edit: when I unplug the power cable, show battery options can be activated. even when I replug the power cable, the options can be selected. but when I restart the options can't be selected again
 

Attachments

  • Screen Shot 2017-11-20 at 13.33.45.png
    Screen Shot 2017-11-20 at 13.33.45.png
    130.8 KB · Views: 87
Last edited:
oh yeah, do you mean kext that I included on clover? now I move it to /Library/Extensions.
the battery status is not showed. 'show battery status on status bar' option on syspref can't be activated.

All kexts you need must be installed to the system volume. That includes FakeSMC.kext.
And config.plist/SystemParameters/InjectKexts=Detect.

After you fix that, attach new problem reporting files.
 
I updated the BIOS in my Hack and have a new entry in the DSDT that I cannot figure out how to patch. I have attached the problem reporting files, along with the patch I am using and a screenshot of the compile error. Thanks for any help.
 

Attachments

  • battery_HP-Elite-X2-v2.txt
    5.3 KB · Views: 113
  • CLOVER.zip
    1.8 MB · Views: 68
  • Gavin’s MacBook 2016.zip
    605.8 KB · Views: 67
  • MacIASL Compile Error.png
    MacIASL Compile Error.png
    201.9 KB · Views: 77
  • Rehabman.zip
    69.3 KB · Views: 60
Back
Top