Contribute
Register

[Guide] Using Clover to "hotpatch" ACPI

Joined
Jul 12, 2017
Messages
10
Motherboard
Laptop > Need make and model > See Rules!
CPU
i7-2860QM/HM65
Graphics
HD 3000
Mac
  1. MacBook Pro
Hello Rehabman, everybody,

I've patched with luck the battery status via hotpatch but I'm still experiencing this weird issue, probably connected with my custom SSDT code:

sometimes, on discharging phase, happend like one plug and immediatly unplug the charger cable while this is not phisically happening... I have the proper sound and also brightness changing of this procedure in that quick moment.

Checked the code many and many times but my knowledge on ACPI patching is limited to your (rehabman) posts.


attatched the requested file,
Thanks really for your work
 

Attachments

  • problem-report.zip
    2.7 MB · Views: 70

Feartech

Moderator
Joined
Aug 3, 2013
Messages
29,218
Motherboard
Asus N752VX-OpenCore
CPU
i7-6700HQ / HM170
Graphics
HD 530 1920 x 1080
Mac
  1. iMac
Mobile Phone
  1. iOS
Hello Rehabman, everybody,

I've patched with luck the battery status via hotpatch but I'm still experiencing this weird issue, probably connected with my custom SSDT code:

sometimes, on discharging phase, happend like one plug and immediatly unplug the charger cable while this is not phisically happening... I have the proper sound and also brightness changing of this procedure in that quick moment.

Checked the code many and many times but my knowledge on ACPI patching is limited to your (rehabman) posts.


attatched the requested file,
Thanks really for your work
MacBookPro14,1 would be a better choice

FakeSMC.kext seems to be missing from /Library/Extensions for some reason?


How and where to install kexts:
 

RehabMan

Moderator
Joined
May 2, 2012
Messages
183,779
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Hello Rehabman, everybody,

I've patched with luck the battery status via hotpatch but I'm still experiencing this weird issue, probably connected with my custom SSDT code:

sometimes, on discharging phase, happend like one plug and immediatly unplug the charger cable while this is not phisically happening... I have the proper sound and also brightness changing of this procedure in that quick moment.

Checked the code many and many times but my knowledge on ACPI patching is limited to your (rehabman) posts.


attatched the requested file,
Thanks really for your work

Different result with static patch?
 
Joined
Jul 12, 2017
Messages
10
Motherboard
Laptop > Need make and model > See Rules!
CPU
i7-2860QM/HM65
Graphics
HD 3000
Mac
  1. MacBook Pro
Different result with static patch?

Yes but maybe I kept the static patch for a too short time to observe the syntom.


MacBookPro14,1 would be a better choice

FakeSMC.kext seems to be missing from /Library/Extensions for some reason?


How and where to install kexts:

FakeSMC.kext was missing from /L/E for my ignorance, now thanks to your post and guide the overall system stability get a hugely improvement and other minor issues are also disappered. Still testing the battery status, but fingers cross, seems ok for now.

Thanks both
 
Joined
Dec 10, 2013
Messages
159
Motherboard
Huawei Matebook D 2017
CPU
i5-7200U
Graphics
HD 620
Hi,
i'm trying to create an hotpach for my brightness key. I already applied the code on my DSDT to check if it works and it's ok.

Code:
Method (_Q01, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0405) //DOWN
        }
Method (_Q02, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0406) //UP
        }

If i apply that code directly in the DSDT i can control brightness using my keyboard.
I then have created an hotpatch like this :
Code:
DefinitionBlock ("", "SSDT", 2, "hack", "BRIG", 0x00000000)
{
    External(_SB.PCI0.LPCB.EC, DeviceObj)
    External(_SB.PCI0.LPCB.PS2K, DeviceObj)
    Scope(_SB.PCI0.LPCB.EC)
    {
        Method (_Q01, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0405) //DOWN
        }
        Method (_Q02, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0406) //UP
        }
    }
}
and renamed in Clover _Q01 to XQ01 and _Q02 to XQ02 but it doesn't work.
To check if the problem was the hotpach or the renaming in clover i inserted again the DSDT leaving the hotpatch.aml too.
If the rename was working clover should have renamed _Q01 to XQ01 so the brightness should have not work even if the patched DSDT was there (right ?) but it works.
So i think is the rename not working but i don't know why.

Could someone please help me ?


EDIT : Solved. I was making a mistake in the Method. it should have been just PS2K instead of \_SB.PCI0.LPCB.PS2K
 

Attachments

  • debug_30823.zip
    2.2 MB · Views: 122
Last edited:

RehabMan

Moderator
Joined
May 2, 2012
Messages
183,779
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Hi,
i'm trying to create an hotpach for my brightness key. I already applied the code on my DSDT to check if it works and it's ok.

Code:
Method (_Q01, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0405) //DOWN
        }
Method (_Q02, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0406) //UP
        }

If i apply that code directly in the DSDT i can control brightness using my keyboard.
I then have created an hotpatch like this :
Code:
DefinitionBlock ("", "SSDT", 2, "hack", "BRIG", 0x00000000)
{
    External(_SB.PCI0.LPCB.EC, DeviceObj)
    External(_SB.PCI0.LPCB.PS2K, DeviceObj)
    Scope(_SB.PCI0.LPCB.EC)
    {
        Method (_Q01, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0405) //DOWN
        }
        Method (_Q02, 0, NotSerialized)  // _Qxx: EC Query
        {
                Notify(\_SB.PCI0.LPCB.PS2K, 0x0406) //UP
        }
    }
}
and renamed in Clover _Q01 to XQ01 and _Q02 to XQ02 but it doesn't work.
To check if the problem was the hotpach or the renaming in clover i inserted again the DSDT leaving the hotpatch.aml too.
If the rename was working clover should have renamed _Q01 to XQ01 so the brightness should have not work even if the patched DSDT was there (right ?) but it works.
So i think is the rename not working but i don't know why.

Could someone please help me ?


EDIT : Solved. I was making a mistake in the Method. it should have been just PS2K instead of \_SB.PCI0.LPCB.PS2K

The problem is your config.plist has no effective rename for _Q01/_Q02.
It is quite evident in your patchmatic -extract output (DSDT.aml).
 
Joined
Dec 10, 2013
Messages
159
Motherboard
Huawei Matebook D 2017
CPU
i5-7200U
Graphics
HD 620
The problem is your config.plist has no effective rename for _Q01/_Q02.
It is quite evident in your patchmatic -extract output (DSDT.aml).
Yes thank you !
 
Joined
Mar 22, 2016
Messages
30
Motherboard
Laptop make & model # > See Rules!
CPU
I5-3217U
Graphics
HD 4000, NVIDIA GT720M
Mac
  1. MacBook Pro
Classic Mac
  1. Portable
Mobile Phone
  1. Android
Hi Rehabman, my battery status not showing, in my DSDT have 2 device BAT is BAT1 and BAT2 : so i want to disable BAT2 to enable Battery status, how ? . Because in DSDT patch im using Disable BAT1, BAT2 patchs . I don't know convert this to hotpatch in clover :(
 
Joined
Mar 20, 2017
Messages
15
Motherboard
HP Zhan66 Pro G2-Clover
CPU
i5-8265U
Graphics
UHD 620(3EA0),1920*1080
Hi Rehabman,
I have done some work with your post. On my laptop, it seems that most of the functions are working. But I have observed that every time the phone is turned on, some ACPI errors are output on the screen. Can you help me fix these mistakes?
Sorry for my poor English.
Thank you for your great work.
 

Attachments

  • HP-Zhan66-G2(Whiskey Lake).zip
    4 MB · Views: 84
Last edited:
Joined
May 6, 2014
Messages
213
Motherboard
Huawei Matebook D15 BOHB-WAX9
CPU
i5-10210U
Graphics
Intel UHD Graphics (1920x1080)
Mac
  1. MacBook Air
Mobile Phone
  1. Other
can someone make hot patch for battery
I couldn't make hot patch for battery this is very static patch
I attached required file
 

Attachments

  • Fujitsu.zip
    65 KB · Views: 100
Top