Contribute
Register

[Guide] Using Clover to "hotpatch" ACPI

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,691
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
For example, If I have a Name (EXP1, 1000). I want to append it with a string like it says,
Code:
Local0 = "Value of EXP1 is: " + EXP1 // This is wrong. Gives me a panic.

You would need to convert the number to text, then concatenate the two strings.
Would require creating a integer -> string converter method and a string concatenation method.

But if you're just trying to output them in debug, use ACPIDebug.kext.
Code:
\RMDT.P2("Value of EXP1 is:", EXP1)
 
Joined
Jul 11, 2014
Messages
436
Motherboard
Asus A555LAB
CPU
i3-4005U
Graphics
HD 4400
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
@RehabMan like ioio is for IOREG is there any utility to call ACPI methods on macOS?
Similar to acpi_call on Linux?
I searched but couldn’t find one :(
 
Joined
Sep 5, 2016
Messages
19
Motherboard
XPS 15 9550 4825T
CPU
Intel(R) Core(TM) i7-6700HQ @ 2.60GHz
Graphics
Intel HD 530 & NVIDIA GTX 960M
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
Hello,Rehabman.

I want to Remove a device called "LID0" and i write a patch in CLover with "LID0 > LIDX" but just like with no use...

How we can remove some devices with hotpatch?
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,691
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Hello,Rehabman.

I want to Remove a device called "LID0" and i write a patch in CLover with "LID0 > LIDX" but just like with no use...

How we can remove some devices with hotpatch?

What problem are you trying to fix?
 
Joined
Sep 5, 2016
Messages
19
Motherboard
XPS 15 9550 4825T
CPU
Intel(R) Core(TM) i7-6700HQ @ 2.60GHz
Graphics
Intel HD 530 & NVIDIA GTX 960M
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
What problem are you trying to fix?

My pad have problem with backlight because it have LID0 device in DSDT but my pad dont have any LID devices.

So i must delete this device to avoid blackscreen.

In traditional method i can delete this device easily but when i use hotpatch it become hard...

I want to know if have some method to avoid or delete some device in DSDT var hotpatch.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,691
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
My pad have problem with backlight because it have LID0 device in DSDT but my pad dont have any LID devices.

So i must delete this device to avoid blackscreen.

In traditional method i can delete this device easily but when i use hotpatch it become hard...

I want to know if have some method to avoid or delete some device in DSDT var hotpatch.

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 5, 2013
Messages
12
Motherboard
Dell G7-7588
CPU
i7-8750H
Graphics
UHD 630 + GTX 1050Ti (1920x1080)
Mobile Phone
  1. Android
  2. iOS
Hi @RehabMan,
I'm trying to do hotpatch for my laptop battery. I've made the add-on SSDT as per post #1. The SSDT compiled without errors, but I'm not sure I got everything right, especially with this part:
- for the EC fields, create another EC OperationRegion (use a name that is different from the original) and Field definition as a sort of "overlay" which contains only the EC fields you need to patch
- to create the EC overlay, you can use the patched Field/OperationRegion in the patched DSDT, then eliminate unpatched fields
I used the static patch "[bat] HP Pavilion n012tx" from your repo as template. Can you check if there's anything wrong? Thank you so much.
 

Attachments

  • hotpatch battery.zip
    122.3 KB · Views: 49

RehabMan

Moderator
Joined
May 3, 2012
Messages
186,691
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Hi @RehabMan,
I'm trying to do hotpatch for my laptop battery. I've made the add-on SSDT as per post #1. The SSDT compiled without errors, but I'm not sure I got everything right, especially with this part:

I used the static patch "[bat] HP Pavilion n012tx" from your repo as template. Can you check if there's anything wrong? Thank you so much.

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
 
Top