Contribute
Register

[Guide] Using Clover to "hotpatch" ACPI

you can also search for TPD1 for example:

Code:
Device (TPD1)
        {
            Name (HID2, Zero)
            Name (SBFB, ResourceTemplate ()
            {
                I2cSerialBusV2 (0x0015, ControllerInitiated, 0x00061A80,
                    AddressingMode7Bit, "\\_SB.PCI0.I2C0",
                    0x00, ResourceConsumer, , Exclusive,
                    )
            })
            Name (SBFI, ResourceTemplate ()
            {
                Interrupt (ResourceConsumer, Level, ActiveLow, ExclusiveAndWake, ,, _Y25)
                {
                    0x00000000,
                }
            })
            Name (SBFG, ResourceTemplate ()
            {
                GpioInt (Level, ActiveLow, ExclusiveAndWake, PullDefault, 0x0000,
                    "\\_SB.PCI0.GPI0", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x0000
                    }
            })
            CreateWordField (SBFG, 0x17, INT1)
            CreateDWordField (SBFI, \_SB.PCI0.I2C0.TPD1._Y25._INT, INT2)  // _INT: Interrupts
Have recreate Hotpatch file, but not work. seems like rename patches wrong.
I have done the SSDT file as this
Code:
DefinitionBlock ("", "SSDT", 2, "hack", "TPD1", 0x00000000)
{
    External (_SB_.PCI0.GPI0, DeviceObj)    // (from opcode)
    External (_SB_.PCI0.I2C0.TPD1, DeviceObj)    // (from opcode)

    Scope (_SB.PCI0.I2C0.TPD1)
    {
        Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
        {
            Name (SBFG, ResourceTemplate ()
            {
                GpioInt (Level, ActiveLow, ExclusiveAndWake, PullDefault, 0x0000,
                    "\\_SB.PCI0.GPI0", 0x00, ResourceConsumer, ,
                    )
                    {   // Pin list
                        0x001B
                    }
            })
            Name (SBFB, ResourceTemplate ()
            {
                I2cSerialBusV2 (0x0015, ControllerInitiated, 0x00061A80,
                    AddressingMode7Bit, "\\_SB.PCI0.I2C0",
                    0x00, ResourceConsumer, , Exclusive,
                    )
            })
            Return (ConcatenateResTemplate (SBFB, SBFG))
        }
    }
}
cause don't know how to caculate "Method (_CRS" in TPD1 as Hex value , only add patches rename _CRS to XCRS
Code:
<dict>
                    <key>Comment</key>
                    <string>_CRS rename to XCRS</string>
                    <key>Disabled</key>
                    <false/>
                    <key>Find</key>
                    <data>
                    X0NSUw==
                    </data>
                    <key>Replace</key>
                    <data>
                    WENSUw==
                    </data>
                    <key>TgtBridge</key>
                    <data>
                    VFBEMQ==
                    </data>
                </dict>
after reboot, system ACPI file change like this
Code:
            Method (XCRS, 0, NotSerialized)
            {
                If (LLess (OSYS, 0x07DC))
                {
                    Return (SBFI)
                }

                If (LEqual (SDM0, Zero))
                {
                    Return (ConcatenateResTemplate (SBFB, SBFG))
                }

                Return (ConcatenateResTemplate (SBFB, SBFI))
            }
 
Hello all! I recently transitioned from Windows-Linux combinations to macOS Catalina with my Asus UX430UNR and totally hackintosh noob. My laptop comes with battery charge threshold by default, and it's controlled by a charging circuit which can be programmed by simple ACPI calls. An example of how I done it in Linux is in here.

As it can be seen from the link;

Code:
$ echo "\_SB.PCI0.LPCB.EC0.WRAM 0x3af 0x50" > /proc/acpi/call

this block makes the appropriate ACPI call and activates the thresholding circuit for the desired threshold level. How can one achieve the same thing in hackintosh?

Best wishes...
 
Hello!

can you guys check if there is any error or patch missing out
so i can have the best config running.

Code:
Last login: Mon May 25 18:43:04 on ttys000
Leonardos-iMac:~ leonardonovaes$ kextstat|grep -y acpiplat
   13    1 0xffffff7f82495000 0x60000    0x60000    com.apple.driver.AppleACPIPlatform (4.0) A29C7512-D3A8-3AED-9721-3A5FF1A32EB2 <12 11 7 6 5 4 3 1>
Leonardos-iMac:~ leonardonovaes$ kextstat|grep -y appleintelcpu
   22    0 0xffffff7f82131000 0x2b000    0x2b000    com.apple.driver.AppleIntelCPUPowerManagement (218.0.0) 917C14A9-67C6-3D62-B175-F802514D060C <7 6 5 4 3 1>
Leonardos-iMac:~ leonardonovaes$
Leonardos-iMac:~ leonardonovaes$ kextstat|grep -y applelpc
   94    0 0xffffff7f82082000 0x3000     0x3000     com.apple.driver.AppleLPC (3.1) AA925C35-3766-3621-BC93-B49EA0D6522E <63 12 5 4 3>
Leonardos-iMac:~ leonardonovaes$ sudo touch /System/Library/Extensions && sudo kextcache -u /
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext RealtekRTL8111.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext AppleIntelE1000e.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext NullCPUPowerManagement.kext
kext-dev-mode allowing invalid signature -67054 0xFFFFFFFFFFFEFA12 for kext ACPI_SMC_PlatformPlugin.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext HDAEnabler1.kext
AppleHSBluetoothDriver.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleHSBluetoothDriver.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleHSBluetoothDriver.kext is missing dependencies (including anyway; dependencies may be available from elsewhere)
AppleBluetoothHIDMouse.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothHIDMouse.kext is missing dependencies (including anyway; dependencies may be available from elsewhere)
AppleBluetoothHIDKeyboard.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothHIDKeyboard.kext is missing dependencies (including anyway; dependencies may be available from elsewhere)
kext-dev-mode allowing invalid signature -67054 0xFFFFFFFFFFFEFA12 for kext AppleHDA.kext
AppleBluetoothMultitouch.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleBluetoothMultitouch.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothMultitouch.kext is missing dependencies (including anyway; dependencies may be available from elsewhere)
AppleHSBluetoothDriver.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleHSBluetoothDriver.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothHIDMouse.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothHIDKeyboard.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothMultitouch.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleBluetoothMultitouch.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleHSBluetoothDriver.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleHSBluetoothDriver.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
Prelink failed for com.apple.driver.AppleHSBluetoothDriver; omitting from prelinked kernel.
AppleBluetoothHIDMouse.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
Prelink failed for com.apple.driver.AppleBluetoothHIDMouse; omitting from prelinked kernel.
AppleBluetoothHIDKeyboard.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
Prelink failed for com.apple.driver.AppleBluetoothHIDKeyboard; omitting from prelinked kernel.
AppleBluetoothMultitouch.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleBluetoothMultitouch.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
Prelink failed for com.apple.driver.AppleBluetoothMultitouch; omitting from prelinked kernel.
 

Attachments

  • DSDT.zip
    9.4 KB · Views: 109
  • EFI.zip
    22.4 MB · Views: 120
  • IOREG.zip
    507.3 KB · Views: 103
Hello!

can you guys check if there is any error or patch missing out
so i can have the best config running.

Code:
Last login: Mon May 25 18:43:04 on ttys000
Leonardos-iMac:~ leonardonovaes$ kextstat|grep -y acpiplat
   13    1 0xffffff7f82495000 0x60000    0x60000    com.apple.driver.AppleACPIPlatform (4.0) A29C7512-D3A8-3AED-9721-3A5FF1A32EB2 <12 11 7 6 5 4 3 1>
Leonardos-iMac:~ leonardonovaes$ kextstat|grep -y appleintelcpu
   22    0 0xffffff7f82131000 0x2b000    0x2b000    com.apple.driver.AppleIntelCPUPowerManagement (218.0.0) 917C14A9-67C6-3D62-B175-F802514D060C <7 6 5 4 3 1>
Leonardos-iMac:~ leonardonovaes$
Leonardos-iMac:~ leonardonovaes$ kextstat|grep -y applelpc
   94    0 0xffffff7f82082000 0x3000     0x3000     com.apple.driver.AppleLPC (3.1) AA925C35-3766-3621-BC93-B49EA0D6522E <63 12 5 4 3>
Leonardos-iMac:~ leonardonovaes$ sudo touch /System/Library/Extensions && sudo kextcache -u /
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext RealtekRTL8111.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext AppleIntelE1000e.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext NullCPUPowerManagement.kext
kext-dev-mode allowing invalid signature -67054 0xFFFFFFFFFFFEFA12 for kext ACPI_SMC_PlatformPlugin.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext HDAEnabler1.kext
AppleHSBluetoothDriver.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleHSBluetoothDriver.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleHSBluetoothDriver.kext is missing dependencies (including anyway; dependencies may be available from elsewhere)
AppleBluetoothHIDMouse.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothHIDMouse.kext is missing dependencies (including anyway; dependencies may be available from elsewhere)
AppleBluetoothHIDKeyboard.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothHIDKeyboard.kext is missing dependencies (including anyway; dependencies may be available from elsewhere)
kext-dev-mode allowing invalid signature -67054 0xFFFFFFFFFFFEFA12 for kext AppleHDA.kext
AppleBluetoothMultitouch.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleBluetoothMultitouch.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothMultitouch.kext is missing dependencies (including anyway; dependencies may be available from elsewhere)
AppleHSBluetoothDriver.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleHSBluetoothDriver.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothHIDMouse.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothHIDKeyboard.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleBluetoothMultitouch.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleBluetoothMultitouch.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
AppleHSBluetoothDriver.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleHSBluetoothDriver.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
Prelink failed for com.apple.driver.AppleHSBluetoothDriver; omitting from prelinked kernel.
AppleBluetoothHIDMouse.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
Prelink failed for com.apple.driver.AppleBluetoothHIDMouse; omitting from prelinked kernel.
AppleBluetoothHIDKeyboard.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
Prelink failed for com.apple.driver.AppleBluetoothHIDKeyboard; omitting from prelinked kernel.
AppleBluetoothMultitouch.kext - dependency 'com.apple.iokit.IOBluetoothFamily' not found.
AppleBluetoothMultitouch.kext - dependency 'com.apple.driver.IOBluetoothHIDDriver' not found.
Prelink failed for com.apple.driver.AppleBluetoothMultitouch; omitting from prelinked kernel.
you can see from your kextache output you have some issues, did you delete some kexts from your system?
 
you can see from your kextache output you have some issues, did you delete some kexts from your system?

Yes, i delete some system kexts related to bluetooth and multitouch things that i do not have on my machine a while ago,
but that error msg is not my real problem.

i´m having issues about kernel_task using too much cpu and memory, so i decided to try the SSDT patches
to try some fixes and see if it work out.
 
Yes, i delete some system kexts related to bluetooth and multitouch things that i do not have on my machine a while ago,
but that error msg is not my real problem.

i´m having issues about kernel_task using too much cpu and memory, so i decided to try the SSDT patches
to try some fixes and see if it work out.
you shouldn't be deleting Apple System kexts, that can cause issues
 
you shouldn't be deleting Apple System kexts, that can cause issues
Sure Thing ! i was trying to see if they really make difference in my problem! i'll fix that later.

But with the DSDT files did you take a look, did you find any fix that i should make ?
 
Sure Thing ! i was trying to see if they really make difference in my problem! i'll fix that later.

But with the DSDT files did you take a look, did you find any fix that i should make ?
i only looked at the huge kextcache issue you had
 
Hey everyone,

To get my touchpad/touchscreen working, I need to patch my DSDT. It involves changing an if statement that checks a variable called USTP to always run.

Looking at the assembled ASL files, I need to change this line:
Code:
000318AA:  A0 4C 48 55 53 54 50 ...    ".LHUSTP"

To this one:
Code:
000318AA:  A0 49 48 01 ............    ".IH."

I know ACPI hotpatches are supposed to be of the same length, but a patch like the following in Clover seems to work:
Code:
Comment: Change USTP to One (to fix I2C)
   Find: <A04C4855 535450>
Replace: <A0494801>

Unfortunately, OpenCore doesn't like the different lengths, and complains when loading.

Is there anything I can do to fix this? Does ASL have a whitespace byte?
 
Hello, after following your guide on how to patch the DSDT to have a working battery status, I've followed the post #2 of this guide to get an SSDT.aml to hot patch the battery status on the fly. However, it's not working... When turning on my laptop, the Battery Status doesn't appear at all. However, I've found that by plugging or removing the AC adapter, it starts to displays 0% (chagrin or not charging, depending on wether if the AC adapter is connected or not).

So far, I've concluded that ONLY the following blocks need to be addressed (and that's what I've attempted on the SSDT file):

SMD0, 256, //found in methods: SMWR, _CRS, _STA
BADC, 16, //No methods (or results) found, no patch needed
BFCC, 16, //found in methods: UPBI, GBIF
MCUR, 16, //found in methods: UPBS, GBCO
MBRM, 16, //found in method: UPBS
MBCV, 16, //found in method: UPBS

Attach you'll find the Patch I've created for my HP Spectre, the SSDT.dsl file I'm attempting to create, and finally, the original DSDT.dsl file. Hopefully, somebody can point me towards what I'm doing wrong? Thank you very much!
 

Attachments

  • HP Spectre Battery Patch.txt
    6.3 KB · Views: 112
  • SSDT-HP-Spectre-Battery.dsl
    29 KB · Views: 87
  • DSDT.dsl
    1.6 MB · Views: 113
Back
Top