Contribute
Register

[Guide] Using Clover to "hotpatch" ACPI

Fix your sloppy indenting and you will see your close braces are not balanced.
Fix your sloppy indenting and you will see your close braces are not balanced.
you're right,have fix it. Now get trouble about "error 6085 - Object not found or not accessible from scope (^^EC.MUTX)".I try to search "EC.MUTX"in my patched dsdt.aml file, but there none Method name EC.MUTX or MUTX,no idea how to do with it.please help, thanks.
 

Attachments

  • 2th.zip
    90.8 KB · Views: 81
you're right,have fix it. Now get trouble about "error 6085 - Object not found or not accessible from scope (^^EC.MUTX)".I try to search "EC.MUTX"in my patched dsdt.aml file, but there none Method name EC.MUTX or MUTX,no idea how to do with it.please help, thanks.

EC.MUTX is declared in the EC device just after the EC query methods in DSDT:
Code:
        Device (EC)
        {
...
            Method (_QFA, 0, NotSerialized)  // _Qxx: EC Query
            {
                Store (0xFA, P80H)
            }

            Mutex (MUTX, 0x00)

You have to use External to reach it from your DSDT:
Code:
External(_SB.PCI0.LPCB.EC.MUTX, MutexObj)

Also, you have _BST and _BIF in the wrong scope.
If you look closely at your DSDT, _BST (and _BIF) are in _SB.PCI0.LPCB.BAT0.
But your SSDT is putting them in _SB.PCI0.LPCB.

And you have some wrong Externals at the top. _BST and _BIT (what is that?) are not Devices.
Remove:
Code:
    External(\_SB.PCI0.LPCB.BAT0._BST, DeviceObj)
    External(\_SB.PCI0.LPCB.BAT0._BIT, DeviceObj)
 
EC.MUTX is declared in the EC device just after the EC query methods in DSDT:
Code:
        Device (EC)
        {
...
            Method (_QFA, 0, NotSerialized)  // _Qxx: EC Query
            {
                Store (0xFA, P80H)
            }

            Mutex (MUTX, 0x00)

You have to use External to reach it from your DSDT:
Code:
External(_SB.PCI0.LPCB.EC.MUTX, MutexObj)

Also, you have _BST and _BIF in the wrong scope.
If you look closely at your DSDT, _BST (and _BIF) are in _SB.PCI0.LPCB.BAT0.
But your SSDT is putting them in _SB.PCI0.LPCB.

And you have some wrong Externals at the top. _BST and _BIT (what is that?) are not Devices.
Remove:
Code:
    External(\_SB.PCI0.LPCB.BAT0._BST, DeviceObj)
    External(\_SB.PCI0.LPCB.BAT0._BIT, DeviceObj)
thanks correct my mistake,I'm studying about apci files, there may many stupid mistaks。any way ,I'm on the way.
 
thanks correct my mistake,I'm studying about apci files, there may many stupid mistaks。any way ,I'm on the way.

Yeah... this is programming. Computers are dumb. They only do what you tell them to do.
When you have something not working, look for the reason.
 
Can't inject additional SSDT's. What am I doing wrong? Attaching problem reporting files and console log:
Code:
Donnys-MacBook-Air:~ donny$ kextstat|grep -y acpiplat
   13    2 0xffffff7f82c1c000 0x66000    0x66000    com.apple.driver.AppleACPIPlatform (4.0) A29C7512-D3A8-3AED-9721-3A5FF1A32EB2 <12 11 7 6 5 4 3 1>
Donnys-MacBook-Air:~ donny$ kextstat|grep -y appleintelcpu
Donnys-MacBook-Air:~ donny$ kextstat|grep -y applelpc
Donnys-MacBook-Air:~ donny$ sudo touch /System/Library/Extensions && sudo kextcache -u /
Password:
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext SATA-100-series-unsupported.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext RealtekRTL8111.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext IntelBacklight.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakeSMC.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 AppleHDA_CX20751.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ACPIBatteryManager.kext
 

Attachments

  • problemReportingFiles.zip
    3.1 MB · Views: 113
Can't inject additional SSDT's. What am I doing wrong? Attaching problem reporting files and console log:
Code:
Donnys-MacBook-Air:~ donny$ kextstat|grep -y acpiplat
   13    2 0xffffff7f82c1c000 0x66000    0x66000    com.apple.driver.AppleACPIPlatform (4.0) A29C7512-D3A8-3AED-9721-3A5FF1A32EB2 <12 11 7 6 5 4 3 1>
Donnys-MacBook-Air:~ donny$ kextstat|grep -y appleintelcpu
Donnys-MacBook-Air:~ donny$ kextstat|grep -y applelpc
Donnys-MacBook-Air:~ donny$ sudo touch /System/Library/Extensions && sudo kextcache -u /
Password:
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext SATA-100-series-unsupported.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext RealtekRTL8111.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext IntelBacklight.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext FakeSMC.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 AppleHDA_CX20751.kext
kext-dev-mode allowing invalid signature -67062 0xFFFFFFFFFFFEFA0A for kext ACPIBatteryManager.kext

You are not booting with the config.plist you attached.
The config.plist you're using has SortedOrder.
Look at your Clover bootlog:
Code:
47:213  0:000  === [ ACPIPatchedAML ] ====================================
47:213  0:000  Sorted
47:213  0:000  Inserting table[0]:SSDT.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[1]:SSDT-0.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[2]:SSDT-1.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[3]:SSDT-2.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[4]:SSDT-3.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[5]:SSDT-4.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[6]:SSDT-5.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[7]:SSDT-6.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[8]:SSDT-7.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[9]:SSDT-8.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[10]:SSDT-9.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[11]:SSDT-10.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[12]:SSDT-11.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[13]:SSDT-12.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[14]:SSDT-13.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[15]:SSDT-14.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[16]:SSDT-15.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[17]:SSDT-16.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[18]:SSDT-17.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[19]:SSDT-18.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[20]:SSDT-19.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[21]:SSDT-XOSI.aml from EFI\CLOVER\ACPI\patched ... Not Found
47:213  0:000  Inserting table[22]:SSDT-LPC.aml from EFI\CLOVER\ACPI\patched ... Not Found
 
Yeah... this is programming. Computers are dumb. They only do what you tell them to do.
When you have something not working, look for the reason.
wow,I work it out.thanks your leading.
Edit:
I'm going patch for discrete graphics, here's something confuse and need your help。
follow "
[Guide] Disabling discrete graphics in dual-GPU laptops
"find out files may contain the relate code to control graphic.
Code:
cuiwenzhis-MBP:disassembly wenzhi$ grep -l Method.*_INI *.dsl
DSDT.dsl
SSDT-15.dsl
SSDT-5.dsl
cuiwenzhis-MBP:disassembly wenzhi$ grep -l Method.*_OFF *.dsl
SSDT-15.dsl
SSDT-3.dsl
SSDT-5.dsl
then search 'Method (_IN' in all of them,all like this:
Code:
All Method (_INI:
in DSDT
Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                If (CondRefOf (\_SB.PCI0.XHC.RHUB.INIR))
                {
                    ^RHUB.INIR ()
                }
            }

Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                If (LLess (OSYS, 0x07DC))
                {
                    SRXO (GPDI, One)
                }

                Store (GNUM (GPDI), INT1)
                Store (INUM (GPDI), INT2)
                If (LEqual (SDM0, Zero))
                {
                    SHPO (GPDI, One)
                }

                If (LEqual (SDS0, One))
                {
                    Store ("SYNA2393", _HID)
                    Store (0x20, HID2)
                    Return (Zero)
                }
            }

Method (_INI, 0, Serialized)  // _INI: Initialize
        {
            Store (0x07D9, OSYS)
            If (CondRefOf (\_OSI, Local0))
            {
                If (_OSI ("Linux"))
                {
                    Store (0x03E8, OSYS)
                }

                If (_OSI ("Windows 2001"))
                {
                    Store (0x07D1, OSYS)
                }

                If (_OSI ("Windows 2001 SP1"))
                {
                    Store (0x07D1, OSYS)
                }

                If (_OSI ("Windows 2001 SP2"))
                {
                    Store (0x07D2, OSYS)
                }

                If (_OSI ("Windows 2001.1"))
                {
                    Store (0x07D3, OSYS)
                }

                If (_OSI ("Windows 2006"))
                {
                    Store (0x07D6, OSYS)
                }

                If (_OSI ("Windows 2009"))
                {
                    Store (0x07D9, OSYS)
                }

                If (_OSI ("Windows 2012"))
                {
                    Store (0x07DC, OSYS)
                }

                If (_OSI ("Windows 2013"))
                {
                    Store (0x07DD, OSYS)
                }

                If (_OSI ("Windows 2015"))
                {
                    Store (0x07DF, OSYS)
                }
            }

            If (CondRefOf (\_PR.DTSE))
            {
                If (LGreaterEqual (\_PR.DTSE, One))
                {
                    Store (One, \_PR.DSAE)
                }
            }
        }

Method (_INI, 0, NotSerialized)  // _INI: Initialize
                {
                    Store (LTR1, LTRE)
                    Store (PML1, LMSL)
                    Store (PNL1, LNSL)
                    Store (OBF1, OBFF)
                }

Method (_INI, 0, NotSerialized)  // _INI: Initialize
                {
                    Store (NIT1, NITV)
                    Store (NPM1, NPMV)
                    Store (NPC1, NPCV)
                    Store (NL11, NL1V)
                    Store (ND21, ND2V)
                    Store (ND11, ND1V)
                    Store (NLR1, NLRV)
                    Store (NLD1, NLDV)
                    Store (NEA1, NEAV)
                    Store (NEB1, NEBV)
                    Store (NEC1, NECV)
                    Store (NRA1, NRAV)
                    Store (NMB1, NMBV)
                    Store (NMV1, NMVV)
                    Store (NPB1, NPBV)
                    Store (NPV1, NPVV)
                    Store (Zero, NCRN)
                }
            }

in SSDT-5
Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (LTRX, LTRS)
            Store (OBFX, OBFS)
        }

Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (LTRY, LTRS)
            Store (OBFY, OBFS)
        }

Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (LTRZ, LTRS)
            Store (OBFZ, OBFS)
        }

in SSDT-15
Scope (\_SB.PCI0.GFX0)
    {
        Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (DID1, Index (TLPK, Zero))
            Store (DID2, Index (TLPK, 0x02))
            Store (DID3, Index (TLPK, 0x04))
            Store (DID4, Index (TLPK, 0x06))
            Store (DID5, Index (TLPK, 0x08))
            Store (DID6, Index (TLPK, 0x0A))
            Store (DID7, Index (TLPK, 0x0C))
            Store (DID2, Index (TLPK, 0x0E))
            Store (DID1, Index (TLPK, 0x0F))
            Store (DID2, Index (TLPK, 0x11))
            Store (DID3, Index (TLPK, 0x12))
            Store (DID2, Index (TLPK, 0x14))
            Store (DID4, Index (TLPK, 0x15))
            Store (DID2, Index (TLPK, 0x17))
            Store (DID5, Index (TLPK, 0x18))
            Store (DID2, Index (TLPK, 0x1A))
            Store (DID6, Index (TLPK, 0x1B))
            Store (DID2, Index (TLPK, 0x1D))
            Store (DID7, Index (TLPK, 0x1E))
        }
….
}
only this look like about some device, but seems not a graphics? thank again.
Code:
Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                If (CondRefOf (\_SB.PCI0.XHC.RHUB.INIR))
                {
                    ^RHUB.INIR ()
                }
            }
 

Attachments

  • origin.zip
    56 KB · Views: 97
  • _OFF and _INI.zip
    3.2 KB · Views: 91
Last edited:
wow,I work it out.thanks your leading.
Edit:
I'm going patch for discrete graphics, here's something confuse and need your help。
follow "
[Guide] Disabling discrete graphics in dual-GPU laptops
"find out files may contain the relate code to control graphic.
Code:
cuiwenzhis-MBP:disassembly wenzhi$ grep -l Method.*_INI *.dsl
DSDT.dsl
SSDT-15.dsl
SSDT-5.dsl
cuiwenzhis-MBP:disassembly wenzhi$ grep -l Method.*_OFF *.dsl
SSDT-15.dsl
SSDT-3.dsl
SSDT-5.dsl
then search 'Method (_IN' in all of them,all like this:
Code:
All Method (_INI:
in DSDT
Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                If (CondRefOf (\_SB.PCI0.XHC.RHUB.INIR))
                {
                    ^RHUB.INIR ()
                }
            }

Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                If (LLess (OSYS, 0x07DC))
                {
                    SRXO (GPDI, One)
                }

                Store (GNUM (GPDI), INT1)
                Store (INUM (GPDI), INT2)
                If (LEqual (SDM0, Zero))
                {
                    SHPO (GPDI, One)
                }

                If (LEqual (SDS0, One))
                {
                    Store ("SYNA2393", _HID)
                    Store (0x20, HID2)
                    Return (Zero)
                }
            }

Method (_INI, 0, Serialized)  // _INI: Initialize
        {
            Store (0x07D9, OSYS)
            If (CondRefOf (\_OSI, Local0))
            {
                If (_OSI ("Linux"))
                {
                    Store (0x03E8, OSYS)
                }

                If (_OSI ("Windows 2001"))
                {
                    Store (0x07D1, OSYS)
                }

                If (_OSI ("Windows 2001 SP1"))
                {
                    Store (0x07D1, OSYS)
                }

                If (_OSI ("Windows 2001 SP2"))
                {
                    Store (0x07D2, OSYS)
                }

                If (_OSI ("Windows 2001.1"))
                {
                    Store (0x07D3, OSYS)
                }

                If (_OSI ("Windows 2006"))
                {
                    Store (0x07D6, OSYS)
                }

                If (_OSI ("Windows 2009"))
                {
                    Store (0x07D9, OSYS)
                }

                If (_OSI ("Windows 2012"))
                {
                    Store (0x07DC, OSYS)
                }

                If (_OSI ("Windows 2013"))
                {
                    Store (0x07DD, OSYS)
                }

                If (_OSI ("Windows 2015"))
                {
                    Store (0x07DF, OSYS)
                }
            }

            If (CondRefOf (\_PR.DTSE))
            {
                If (LGreaterEqual (\_PR.DTSE, One))
                {
                    Store (One, \_PR.DSAE)
                }
            }
        }

Method (_INI, 0, NotSerialized)  // _INI: Initialize
                {
                    Store (LTR1, LTRE)
                    Store (PML1, LMSL)
                    Store (PNL1, LNSL)
                    Store (OBF1, OBFF)
                }

Method (_INI, 0, NotSerialized)  // _INI: Initialize
                {
                    Store (NIT1, NITV)
                    Store (NPM1, NPMV)
                    Store (NPC1, NPCV)
                    Store (NL11, NL1V)
                    Store (ND21, ND2V)
                    Store (ND11, ND1V)
                    Store (NLR1, NLRV)
                    Store (NLD1, NLDV)
                    Store (NEA1, NEAV)
                    Store (NEB1, NEBV)
                    Store (NEC1, NECV)
                    Store (NRA1, NRAV)
                    Store (NMB1, NMBV)
                    Store (NMV1, NMVV)
                    Store (NPB1, NPBV)
                    Store (NPV1, NPVV)
                    Store (Zero, NCRN)
                }
            }

in SSDT-5
Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (LTRX, LTRS)
            Store (OBFX, OBFS)
        }

Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (LTRY, LTRS)
            Store (OBFY, OBFS)
        }

Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (LTRZ, LTRS)
            Store (OBFZ, OBFS)
        }

in SSDT-15
Scope (\_SB.PCI0.GFX0)
    {
        Method (_INI, 0, NotSerialized)  // _INI: Initialize
        {
            Store (DID1, Index (TLPK, Zero))
            Store (DID2, Index (TLPK, 0x02))
            Store (DID3, Index (TLPK, 0x04))
            Store (DID4, Index (TLPK, 0x06))
            Store (DID5, Index (TLPK, 0x08))
            Store (DID6, Index (TLPK, 0x0A))
            Store (DID7, Index (TLPK, 0x0C))
            Store (DID2, Index (TLPK, 0x0E))
            Store (DID1, Index (TLPK, 0x0F))
            Store (DID2, Index (TLPK, 0x11))
            Store (DID3, Index (TLPK, 0x12))
            Store (DID2, Index (TLPK, 0x14))
            Store (DID4, Index (TLPK, 0x15))
            Store (DID2, Index (TLPK, 0x17))
            Store (DID5, Index (TLPK, 0x18))
            Store (DID2, Index (TLPK, 0x1A))
            Store (DID6, Index (TLPK, 0x1B))
            Store (DID2, Index (TLPK, 0x1D))
            Store (DID7, Index (TLPK, 0x1E))
        }
….
}
only this look like about some device, but seems not a graphics? thank again.
Code:
Method (_INI, 0, NotSerialized)  // _INI: Initialize
            {
                If (CondRefOf (\_SB.PCI0.XHC.RHUB.INIR))
                {
                    ^RHUB.INIR ()
                }
            }

_OFF is in SSDT-15. It calls PGOF in SSDT-5. No EC references in either.
ACPI path is _SB.PCI0.PEG0.PEGP.
There is no _INI at that path, so you simply add one in SSDT-15 (just add _INI method that calls _OFF before _OFF).
 
_OFF is in SSDT-15. It calls PGOF in SSDT-5. No EC references in either.
ACPI path is _SB.PCI0.PEG0.PEGP.
There is no _INI at that path, so you simply add one in SSDT-15 (just add _INI method that calls _OFF before _OFF).
Thanks very much,Sloved it.
 
Back
Top