Contribute
Register

[Guide] How to patch DSDT for working battery status

Joined
Feb 15, 2016
Messages
82
Motherboard
Asus X550LB
CPU
i5 4200U
Graphics
HD 4400
Mobile Phone
iOS
Hey man, my battery status was working for like 6 months and then... it stopped working all of a sudden. It always shows 100%. Until I reboot, then sometimes shows proper status, sometimes doesn't. And sometimes just randomly shows 0% and that my Mac will shut down. While in reality I'm using the computer for like 10 minutes. It's all screwed up. Here's all the necessary stuff for problem reporting in the attachment. Should I repatch my computer?

Terminal output:
Code:
kextstat|grep -y acpiplat
   13    2 0xffffff7f82d77000 0x66000    0x66000    com.apple.driver.AppleACPIPlatform (4.0) A29C7512-D3A8-3AED-9721-3A5FF1A32EB2 <12 11 7 6 5 4 3 1>
patchm|⇒ kextstat|grep -y appleintelcpu
patchm|⇒ kextstat|grep -y applelpc
  116    0 0xffffff7f82759000 0x3000     0x3000     com.apple.driver.AppleLPC (3.1) 32BDCF9F-0473-32D4-9DAE-F523EFB2D244 <115 12 5 4 3>
patchm|⇒ sudo touch /System/Library/Extensions && sudo kextcache -u /
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext toledaARPT.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext SmoothMouse.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext IntelBacklight.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext HDAEnabler3.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakePCIID_Intel_HD_Graphics.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakePCIID.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext CodecCommander.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ApplePS2Keyboard.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ApplePS2Controller.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ApplePS2SmartTouchPad.kext
kext-dev-mode allowing invalid signature -67030 0xFFFFFFFFFFFEFA2A for kext AppleHDAHardwareConfigDriver.kext
kext-dev-mode allowing invalid signature -67061 0xFFFFFFFFFFFEFA0B for kext AppleHDA.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ACPIBatteryManager.kext
 

Attachments

RehabMan

Moderator
Joined
May 3, 2012
Messages
189,144
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Hey man, my battery status was working for like 6 months and then... it stopped working all of a sudden. It always shows 100%. Until I reboot, then sometimes shows proper status, sometimes doesn't. And sometimes just randomly shows 0% and that my Mac will shut down. While in reality I'm using the computer for like 10 minutes. It's all screwed up. Here's all the necessary stuff for problem reporting in the attachment. Should I repatch my computer?

Terminal output:
Code:
kextstat|grep -y acpiplat
   13    2 0xffffff7f82d77000 0x66000    0x66000    com.apple.driver.AppleACPIPlatform (4.0) A29C7512-D3A8-3AED-9721-3A5FF1A32EB2 <12 11 7 6 5 4 3 1>
patchm|⇒ kextstat|grep -y appleintelcpu
patchm|⇒ kextstat|grep -y applelpc
  116    0 0xffffff7f82759000 0x3000     0x3000     com.apple.driver.AppleLPC (3.1) 32BDCF9F-0473-32D4-9DAE-F523EFB2D244 <115 12 5 4 3>
patchm|⇒ sudo touch /System/Library/Extensions && sudo kextcache -u /
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext toledaARPT.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext SmoothMouse.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext IntelBacklight.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext HDAEnabler3.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakePCIID_Intel_HD_Graphics.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakePCIID.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext CodecCommander.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ApplePS2Keyboard.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ApplePS2Controller.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ApplePS2SmartTouchPad.kext
kext-dev-mode allowing invalid signature -67030 0xFFFFFFFFFFFEFA2A for kext AppleHDAHardwareConfigDriver.kext
kext-dev-mode allowing invalid signature -67061 0xFFFFFFFFFFFEFA0B for kext AppleHDA.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ACPIBatteryManager.kext
Your _REG method is coded incorrectly. The EC related things from _OFF should only be done when the EC is ready.

You have:
Code:
          Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If (LEqual (Arg0, 0x03))
                {
                    Store (Arg1, ECFL)
                }

                If (LAnd (LEqual (Arg0, 0x03), LEqual (Arg1, One)))
                {
                    SPIN (0x96, Zero)
                }

                Store (RRAM (0x0521), Local0)
                And (Local0, 0xCF, Local0)
                WRAM (0x0521, Local0)
                WRAM (0x0520, 0x95)
                WRAM (0x03A4, Zero)
                WRAM (0x03A5, Zero)
            }
Should be:
Code:
          Method (_REG, 2, NotSerialized)  // _REG: Region Availability
            {
                If (LEqual (Arg0, 0x03))
                {
                    Store (Arg1, ECFL)
                }

                If (LAnd (LEqual (Arg0, 0x03), LEqual (Arg1, One)))
                {
                    SPIN (0x96, Zero)

                    Store (RRAM (0x0521), Local0)
                    And (Local0, 0xCF, Local0)
                    WRAM (0x0521, Local0)
                    WRAM (0x0520, 0x95)
                    WRAM (0x03A4, Zero)
                    WRAM (0x03A5, Zero)
                }
            }
Since this incorrect code may have put your EC into a bad state, you will also need to do an EC reset (after correcting the code).
 
Joined
Feb 15, 2016
Messages
82
Motherboard
Asus X550LB
CPU
i5 4200U
Graphics
HD 4400
Mobile Phone
iOS
Your _REG method is coded incorrectly. The EC related things from _OFF should only be done when the EC is ready.
Sorry this may be off-topic, but I can't seem to disassemble DSDT into .dsl with iasl. I get

Code:
ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20141107/psobject-305)
Doesn't work neither with patchmatic nor F4. All necessary files (if you need to debug) are in my post above. The iasl creates DSDT.dsl file but the contents are:

Code:
Could not parse ACPI tables, AE_ALREADY_EXISTS
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
189,144
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Sorry this may be off-topic, but I can't seem to disassemble DSDT into .dsl with iasl. I get

Code:
ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20141107/psobject-305)
Doesn't work neither with patchmatic nor F4. All necessary files (if you need to debug) are in my post above. The iasl creates DSDT.dsl file but the contents are:

Code:
Could not parse ACPI tables, AE_ALREADY_EXISTS
See guide: https://www.tonymacx86.com/threads/guide-patching-laptop-dsdt-ssdts.152573/
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
189,144
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
MacBook Air
Mobile Phone
iOS
I was indeed following the guide. But failed in the iasl step.
Read it carefully. Sounds to me like you are doing one of two things wrong:
- failing to eliminate duplicate SSDTs
- disassembling files that do not start with DSDT or SSDT

Also, you cannot reliably use patchmatic to extract native ACPI files as they may have been modified by Clover. Use Clover F4 to extract. Eliminate all files not DSDT or SSDT. Eliminate duplicate SSDTs. Then disassemble all the remaining files with refs.txt as per guide.

FYI: I had no issue disassembling your files in CLOVER.ZIP (ACPI/origin) that you provided in post #3518.
I used: iasl -da -dl -fe refs.txt DSDT.aml SSDT*.aml
 
Joined
Feb 15, 2016
Messages
82
Motherboard
Asus X550LB
CPU
i5 4200U
Graphics
HD 4400
Mobile Phone
iOS
Read it carefully. Sounds to me like you are doing one of two things wrong:
- failing to eliminate duplicate SSDTs
- disassembling files that do not start with DSDT or SSDT

Also, you cannot reliably use patchmatic to extract native ACPI files as they may have been modified by Clover. Use Clover F4 to extract. Eliminate all files not DSDT or SSDT. Eliminate duplicate SSDTs. Then disassemble all the remaining files with refs.txt as per guide.

FYI: I had no issue disassembling your files in CLOVER.ZIP (ACPI/origin) that you provided in post #3518.
I used: iasl -da -dl -fe refs.txt DSDT.aml SSDT*.aml
Yeah... I don't have the code snippet you pasted (_REG method) in DSDT.dsl extracted from the ACPI/origin...
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
189,144
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Yeah... I don't have the code snippet you pasted (_REG method) in DSDT.dsl extracted from the ACPI/origin...
Of course not.
It is something you moved from _OFF and/or SGOF from one of the SSDTs as part of the guide for disabling the discrete GPU.
But you did it incorrectly.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
189,144
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
MacBook Air
Mobile Phone
iOS
The patch battery_Lenovo-Yoga-S1 causes some typos for Lenovo S1 Yoga. So I modify it.
I don't see any errors after applying the existing "Lenovo Yoga S1" patch to the DSDT-origin.dsl you attached here.

Note: I don't know why those two patches were created in the section marked "# Commenting out string data"
 
Top