Contribute
Register

[Guide] Using Clover to "hotpatch" ACPI

Joined
Sep 5, 2013
Messages
12
Motherboard
Dell G7-7588
CPU
i7-8750H
Graphics
UHD 630 + GTX 1050Ti (1920x1080)
Mobile Phone
  1. Android
  2. iOS
No need for SMDX in the ERM2 field list (it is not accessed, and the offset is wrong anyway).
CUR0 should start at offset 0x83.
Note original position in ERAM:
Code:
                        Offset (0x82),
                        MBST,   8, //0x82
                        MCUR,   16, //0x83
OK, now my battery status works correctly. I've also got the audio working and NVIDIA GPU disabled after following your comprehensive guide (Thank you so much once again!!). Well, I have one more problem. I don't get graphics acceleration at all. I use SSDT-IGPU from your hotpatch repo for my Intel HD 4400. But it seems the properties is not injected somehow. Am I missing something? Problem reporting files attached.
Screen Shot 2017-12-08 at 4.31.26 PM.png
Code:
Premas-MacBook-Pro:~ putuprema$ sudo touch /System/Library/Extensions && sudo kextcache -u /
Password:
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a954e80 [0x7fffa203d980]> { URL = "AppleBacklightInjector.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.injector.AppleBacklightInjector" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a811c70 [0x7fffa203d980]> { URL = "FakeSMC.kext/ -- file:///System/Library/Extensions/", ID = "org.netkas.driver.FakeSMC" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a811830 [0x7fffa203d980]> { URL = "IntelGraphicsFixup.kext/ -- file:///System/Library/Extensions/", ID = "as.lvs1974.IntelGraphicsFixup" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff147c43e20 [0x7fffa203d980]> { URL = "Lilu.kext/ -- file:///System/Library/Extensions/", ID = "as.vit9696.Lilu" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff147d4ad50 [0x7fffa203d980]> { URL = "VoodooPS2Keyboard.kext/ -- file:///System/Library/Extensions/VoodooPS2Controller.kext/Contents/PlugIns/", ID = "org.rehabman.voodoo.driver.PS2Keyboard" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a7c7ed0 [0x7fffa203d980]> { URL = "VoodooPS2Controller.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.voodoo.driver.PS2Controller" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a7caa50 [0x7fffa203d980]> { URL = "VoodooPS2Trackpad.kext/ -- file:///System/Library/Extensions/VoodooPS2Controller.kext/Contents/PlugIns/", ID = "org.rehabman.voodoo.driver.PS2Trackpad" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a6e0c00 [0x7fffa203d980]> { URL = "FakePCIID.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.driver.FakePCIID" }
Kext with invalid signatured (-67054) allowed: <OSKext 0x7ff147e0b2b0 [0x7fffa203d980]> { URL = "AppleHDA.kext/ -- file:///System/Library/Extensions/", ID = "com.apple.driver.AppleHDA" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a3081f0 [0x7fffa203d980]> { URL = "USBInjectAll.kext/ -- file:///System/Library/Extensions/", ID = "com.rehabman.driver.USBInjectAll" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a2564f0 [0x7fffa203d980]> { URL = "FakePCIID_XHCIMux.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.driver.FakePCIID.XHCIMux" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a18fc80 [0x7fffa203d980]> { URL = "FakePCIID_Intel_HDMI_Audio.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.injector.FakePCIID-Intel-HDMI-Audio" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a17de40 [0x7fffa203d980]> { URL = "CodecCommander.kext/ -- file:///System/Library/Extensions/", ID = "org.tw.CodecCommander" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a1058e0 [0x7fffa203d980]> { URL = "PinConfigs.kext/ -- file:///System/Library/Extensions/AppleALC.kext/Contents/PlugIns/", ID = "as.vit9696.PinConfigs" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a104ce0 [0x7fffa203d980]> { URL = "AppleALC.kext/ -- file:///System/Library/Extensions/", ID = "as.vit9696.AppleALC" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff147c217c0 [0x7fffa203d980]> { URL = "ACPIBatteryManager.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.driver.AppleSmartBatteryManager" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff147c1abe0 [0x7fffa203d980]> { URL = "FakePCIID_Intel_HD_Graphics.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.injector.FakePCIID-Intel-HD-Graphics" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff147c14610 [0x7fffa203d980]> { URL = "RealtekRTL8100.kext/ -- file:///System/Library/Extensions/", ID = "com.insanelymac.RealtekRTL8100" }
KernelCache ID: 66BDB0E344FF80BF3B9A2A460E36C8A3
 

Attachments

  • Problem Reporting.zip
    2.2 MB · Views: 62

the-braveknight

Moderator
Joined
Nov 24, 2015
Messages
1,222
Motherboard
Lenovo Legion Y520 (Clover)
CPU
i7-7700HQ
Graphics
HD 630 (1920x1080) + Nvidia GTX 1060
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Hey RehabMan,
I have a few questions about disabling the discrete graphics card. In my case, there is some EC related code in my original _OFF method. The question is do I have to copy/paste the whole code in original _OFF to XOFF and move the EC code to _REG? Or I can just copy the EC code in _OFF to _REG without overriding _OFF method, will that work? Because laptops similar to Z50-70 have different code in _OFF and I'd like to keep it a bit more generic.
Also, do I have to override the relevant _INI method or I can just call the discrete card's _OFF method from any _INI method?
 

Attachments

  • Screen Shot 2017-12-08 at 1.39.25 PM.png
    Screen Shot 2017-12-08 at 1.39.25 PM.png
    38.4 KB · Views: 87

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
OK, now my battery status works correctly. I've also got the audio working and NVIDIA GPU disabled after following your comprehensive guide (Thank you so much once again!!). Well, I have one more problem. I don't get graphics acceleration at all. I use SSDT-IGPU from your hotpatch repo for my Intel HD 4400. But it seems the properties is not injected somehow. Am I missing something? Problem reporting files attached.
View attachment 298066
Code:
Premas-MacBook-Pro:~ putuprema$ sudo touch /System/Library/Extensions && sudo kextcache -u /
Password:
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a954e80 [0x7fffa203d980]> { URL = "AppleBacklightInjector.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.injector.AppleBacklightInjector" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a811c70 [0x7fffa203d980]> { URL = "FakeSMC.kext/ -- file:///System/Library/Extensions/", ID = "org.netkas.driver.FakeSMC" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a811830 [0x7fffa203d980]> { URL = "IntelGraphicsFixup.kext/ -- file:///System/Library/Extensions/", ID = "as.lvs1974.IntelGraphicsFixup" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff147c43e20 [0x7fffa203d980]> { URL = "Lilu.kext/ -- file:///System/Library/Extensions/", ID = "as.vit9696.Lilu" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff147d4ad50 [0x7fffa203d980]> { URL = "VoodooPS2Keyboard.kext/ -- file:///System/Library/Extensions/VoodooPS2Controller.kext/Contents/PlugIns/", ID = "org.rehabman.voodoo.driver.PS2Keyboard" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a7c7ed0 [0x7fffa203d980]> { URL = "VoodooPS2Controller.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.voodoo.driver.PS2Controller" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a7caa50 [0x7fffa203d980]> { URL = "VoodooPS2Trackpad.kext/ -- file:///System/Library/Extensions/VoodooPS2Controller.kext/Contents/PlugIns/", ID = "org.rehabman.voodoo.driver.PS2Trackpad" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a6e0c00 [0x7fffa203d980]> { URL = "FakePCIID.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.driver.FakePCIID" }
Kext with invalid signatured (-67054) allowed: <OSKext 0x7ff147e0b2b0 [0x7fffa203d980]> { URL = "AppleHDA.kext/ -- file:///System/Library/Extensions/", ID = "com.apple.driver.AppleHDA" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a3081f0 [0x7fffa203d980]> { URL = "USBInjectAll.kext/ -- file:///System/Library/Extensions/", ID = "com.rehabman.driver.USBInjectAll" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a2564f0 [0x7fffa203d980]> { URL = "FakePCIID_XHCIMux.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.driver.FakePCIID.XHCIMux" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a18fc80 [0x7fffa203d980]> { URL = "FakePCIID_Intel_HDMI_Audio.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.injector.FakePCIID-Intel-HDMI-Audio" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a17de40 [0x7fffa203d980]> { URL = "CodecCommander.kext/ -- file:///System/Library/Extensions/", ID = "org.tw.CodecCommander" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a1058e0 [0x7fffa203d980]> { URL = "PinConfigs.kext/ -- file:///System/Library/Extensions/AppleALC.kext/Contents/PlugIns/", ID = "as.vit9696.PinConfigs" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff14a104ce0 [0x7fffa203d980]> { URL = "AppleALC.kext/ -- file:///System/Library/Extensions/", ID = "as.vit9696.AppleALC" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff147c217c0 [0x7fffa203d980]> { URL = "ACPIBatteryManager.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.driver.AppleSmartBatteryManager" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff147c1abe0 [0x7fffa203d980]> { URL = "FakePCIID_Intel_HD_Graphics.kext/ -- file:///System/Library/Extensions/", ID = "org.rehabman.injector.FakePCIID-Intel-HD-Graphics" }
Kext with invalid signatured (-67062) allowed: <OSKext 0x7ff147c14610 [0x7fffa203d980]> { URL = "RealtekRTL8100.kext/ -- file:///System/Library/Extensions/", ID = "com.insanelymac.RealtekRTL8100" }
KernelCache ID: 66BDB0E344FF80BF3B9A2A460E36C8A3

Update your copy of SSDT-IGPU.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Hey RehabMan,
I have a few questions about disabling the discrete graphics card. In my case, there is some EC related code in my original _OFF method. The question is do I have to copy/paste the whole code in original _OFF to XOFF and move the EC code to _REG? Or I can just copy the EC code in _OFF to _REG without overriding _OFF method, will that work? Because laptops similar to Z50-70 have different code in _OFF and I'd like to keep it a bit more generic.

You will need to customize the _OFF method for each such that it corresponds to native _OFF without the EC related code.

Also, do I have to override the relevant _INI method or I can just call the discrete card's _OFF method from any _INI method?

You can probably call from any _INI (as I do in many of my guides), but I wrote the guide to override the specific _INI since that is the safest... because that way the _OFF is always run after the original _INI code has run.
 
Joined
Sep 5, 2013
Messages
12
Motherboard
Dell G7-7588
CPU
i7-8750H
Graphics
UHD 630 + GTX 1050Ti (1920x1080)
Mobile Phone
  1. Android
  2. iOS
Update your copy of SSDT-IGPU.
Edited the ssdt for my laptop, working flawlessly now. Thanks @RehabMan ! I've converted all my static patched DSDT+SSDTs to full hotpatch. It takes a lot of reading though, after that it's not really hard to implement.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Edited the ssdt for my laptop, working flawlessly now. Thanks @RehabMan ! I've converted all my static patched DSDT+SSDTs to full hotpatch. It takes a lot of reading though, after that it's not really hard to implement.

Keep in mind that for a single laptop, it is much easier/better to use Clover to inject graphics properties than SSDT-IGPU.
I use SSDT-IGPU in a lot of my guides because the guides target multiple models where I didn't want to have multiple config.plist files for each model, and instead wanted to determine graphics inject properties dynamically based on the hardware present.
 
Joined
Jul 11, 2014
Messages
436
Motherboard
Asus A555LAB
CPU
i3-4005U
Graphics
HD 4400
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
@RehabMan Just a quick question. Whenever _DSM containing plugin-type is executed there is an error in ACPI log saying : ACPI: cannot translate ACPI object 14

It's not problematic but I would like to know why this error? Can I identify object 14 by any means? Like, we could look at table offset in any hex editor to debug ACPI related error.

One more thing related to Battery hotpatch, I just need to create a EC region with 16 bits registers converted to 8Bits and a few method that can write to EC and one to combine 8bits to 16bits. Right?

Regards
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
@RehabMan Just a quick question. Whenever _DSM containing plugin-type is executed there is an error in ACPI log saying : ACPI: cannot translate ACPI object 14

It's not problematic but I would like to know why this error? Can I identify object 14 by any means? Like, we could look at table offset in any hex editor to debug ACPI related error.

One more thing related to Battery hotpatch, I just need to create a EC region with 16 bits registers converted to 8Bits and a few method that can write to EC and one to combine 8bits to 16bits. Right?

Regards

No "Problem Reporting" files attached.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
 
Joined
Sep 2, 2011
Messages
143
Motherboard
ASUS P8Z68-V PRO/GEN3
CPU
Intel i7 2700K
Graphics
Intel HD 3000
Mobile Phone
  1. iOS
I think the patch for changing the GPRW method to XPRW doesn't work on my system since checking the bootlog i get this:

Code:
[change Method(GPRW,2,N) to XPRW]: pattern 47505257, bin not found / already patched!

What should i do in order to disable instant wake without patching DSDT?
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,689
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
I think the patch for changing the GPRW method to XPRW doesn't work on my system since checking the bootlog i get this:

Code:
[change Method(GPRW,2,N) to XPRW]: pattern 47505257, bin not found / already patched!

What should i do in order to disable instant wake without patching DSDT?

Not all systems use GPRW.
Applicability of patches depends on native ACPI content.

No "Problem Reporting" files attached.
Read FAQ, "Problem Reporting" again. Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
 
Top