Contribute
Register

[Guide] Patching LAPTOP DSDT/SSDTs

RehabMan

Moderator
Joined
May 3, 2012
Messages
190,989
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Hi,

I have a question about DTGP. What is it and do I have to use it? I know that I can enable it in Clover.

I have seen various versions for DSDT hotfixes and some of them use it. For example @RehabMan Maintains the Null Ethernet Network Driver and in https://github.com/RehabMan/OS-X-Null-Ethernet/blob/master/SSDT-RMNE.dsl he uses this:

```
DefinitionBlock("", "SSDT", 2, "RehabMan", "_RMNE", 0x00001000)
{
Device (RMNE)
{
Name (_ADR, Zero)
// The NullEthernet kext matches on this HID
Name (_HID, "NULE0000")
// This is the MAC address returned by the kext. Modify if necessary.
Name (MAC, Buffer() { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 })
Method (_DSM, 4, NotSerialized)
{
If (LEqual (Arg2, Zero)) { Return (Buffer() { 0x03 } ) }
Return (Package()
{
"built-in", Buffer() { 0x00 },
"IOName", "ethernet",
"name", Buffer() { "ethernet" },
"model", Buffer() { "RM-NullEthernet-1001" },
"device_type", Buffer() { "ethernet" },
})
}
}
}
```

However many many patches I have seen in github and other places use this version:

```
DefinitionBlock ("", "SSDT", 2, "hack", "_RMNE", 0x00000000)
{
External (DTGP, MethodObj) // 5 Arguments

Device (RMNE)
{
Name (_ADR, Zero) // _ADR: Address
Name (_HID, "NULE0000") // _HID: Hardware ID
Name (MAC, Buffer (0x06)
{
0x11, 0x22, 0x33, 0x44, 0x55, 0x66 // ."3DUf
})
Method (_DSM, 4, NotSerialized) // _DSM: Device-Specific Method
{
Local0 = Package (0x0A)
{
"built-in",
Buffer (One)
{
0x00 // .
},

"IOName",
"ethernet",
"name",
Buffer (0x09)
{
"ethernet"
},

"model",
Buffer (0x15)
{
"RM-NullEthernet-1001"
},

"device_type",
Buffer (0x09)
{
"ethernet"
}
}
DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
Return (Local0)
}
}
}
```

May I ask why is that and what is the right way to do it? And most importantly can someone give me a very brief explanation of what this DTGP does.

Thanks!
There is no need to use DTGP as the Apple specific _DSM can be implemented without it.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
190,989
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Hi, I am trying to patch a Xiaomi Mi Air 13.3’‘ Skylake-U 2016 running Mojave 10.14.2. I have the following very specific problems:

1. I am using @RehabMan hack-tools (really amazing toolkit) in order to generate a `LiluFriendLite.kext`. It seems that the `create_lilufriend.sh` does not take into account the `CPUFriendDataProvider.kext`. Do I need to add it manually in order to load it or `CPUFriend.kext` loads it since it is codeless?

2. When booting I am getting a lot messages of type power supply unavailable, assuming successful power for XXYY of 750 mWWakePower and 0 mWSleepPower. I inject USB power properties via SSDT-USBX.aml. What may be wrong:

Code:
2019-01-03 18:03:32.566401+0200 0x77       Default     0x0                  0      0    <AppleBusPowerController`AppleBusPowerController::requestStaticServicePowerLocked(IOService*, unsigned int&, unsigned int&)> kernel: (AppleBusPowerController) 000001.566394 AppleBusPowerController: AppleBusPowerController::requestStaticServicePowerLocked: power supply unavailable, assuming successful power for SS01 of 750 mWWakePower and 0 mWSleepPower
2019-01-03 18:03:32.573344+0200 0x77       Default     0x0                  0      0    <AppleBusPowerController`AppleBusPowerController::requestStaticServicePowerLocked(IOService*, unsigned int&, unsigned int&)> kernel: (AppleBusPowerController) 000001.573338 AppleBusPowerController: AppleBusPowerController::requestStaticServicePowerLocked: power supply unavailable, assuming successful power for SS02 of 750 mWWakePower and 0 mWSleepPower
2019-01-03 18:03:32.573601+0200 0x77       Default     0x0                  0      0    <AppleBusPowerController`AppleBusPowerController::requestStaticServicePowerLocked(IOService*, unsigned int&, unsigned int&)> kernel: (AppleBusPowerController) 000001.573596 AppleBusPowerController: AppleBusPowerController::requestStaticServicePowerLocked: power supply unavailable, assuming successful power for SS03 of 750 mWWakePower and 0 mWSleepPower
2019-01-03 18:03:32.573883+0200 0x77       Default     0x0                  0      0    <AppleBusPowerController`AppleBusPowerController::requestStaticServicePowerLocked(IOService*, unsigned int&, unsigned int&)> kernel: (AppleBusPowerController) 000001.573878 AppleBusPowerController: AppleBusPowerController::requestStaticServicePowerLocked: power supply unavailable, assuming successful power for SS04 of 750 mWWakePower and 0 mWSleepPower
2019-01-03 18:03:32.574132+0200 0x65       Default     0x0                  0      0    kernel: Waiting on <dict ID="0"><key>IOProviderClass</key><string ID="1">IOResources</string><key>IOResourceMatch</key><string ID="2">boot-uuid-media</string></dict>
2019-01-03 18:03:32.590052+0200 0x77       Default     0x0                  0      0    <AppleBusPowerController`AppleBusPowerController::requestStaticServicePowerLocked(IOService*, unsigned int&, unsigned int&)> kernel: (AppleBusPowerController) 000001.590048 AppleBusPowerController: AppleBusPowerController::requestStaticServicePowerLocked: power supply unavailable, assuming successful power for SS03 of 750 mWWakePower and 0 mWSleepPower
3. When booting I am getting a lot of these messages related to the camera. My camera works. Is this something I need to worry?

Code:
2019-01-03 18:03:41.027274+0200 0x1fc      Default     0x0                  0      0    kernel: Notice - new kext com.apple.driver.KextExcludeList, v14.0.3 matches prelinked kext but can't determine if executables are the same (no UUIDs).
2019-01-03 18:03:41.107540+0200 0x1fc      Default     0x0                  0      0    kernel: Matching service count = 14
2019-01-03 18:03:41.108071+0200 0x1fc      Default     0x0                  0      0    kernel: Matching service count = 21
2019-01-03 18:03:41.111504+0200 0x1fc      Default     0x0                  0      0    kernel: XiaoMi USB 2.0 Webcam: family specific matching fails
2019-01-03 18:03:41.111510+0200 0x1fc      Default     0x0                  0      0    kernel: AppleUSBInterface: family specific matching fails
2019-01-03 18:03:41.111514+0200 0x1fc      Default     0x0                  0      0    kernel: CDC Communications Control: family specific matching fails
2019-01-03 18:03:41.111517+0200 0x1fc      Default     0x0                  0      0    kernel: AppleUSBInterface: family specific matching fails
2019-01-03 18:03:41.111520+0200 0x1fc      Default     0x0                  0      0    kernel: Matching service count = 33

2019-01-03 18:03:41.113441+0200 0x1fc      Default     0x0                  0      0    kernel: XiaoMi USB 2.0 Webcam: family specific matching fails
2019-01-03 18:03:41.113445+0200 0x1fc      Default     0x0                  0      0    kernel: AppleUSBInterface: family specific matching fails
2019-01-03 18:03:41.113449+0200 0x1fc      Default     0x0                  0      0    kernel: CDC Communications Control: family specific matching fails
2019-01-03 18:03:41.113453+0200 0x1fc      Default     0x0                  0      0    kernel: AppleUSBInterface: family specific matching fails
2019-01-03 18:03:41.113455+0200 0x1fc      Default     0x0                  0      0    kernel: Matching service count = 35
4. And finally I get these messages that reference the battery and I am not sure if I am missing something:

Code:
2019-01-03 18:03:42.482981+0200 0x200      Default     0x0                  0      0    <IOPlatformPluginFamily`DebugPrint> kernel: (IOPlatformPluginFamily) High standby delay is not specified! Defaulting to 0x2a30
2019-01-03 18:03:42.482983+0200 0x200      Default     0x0                  0      0    <IOPlatformPluginFamily`DebugPrint> kernel: (IOPlatformPluginFamily) High standby delay is not specified! Defaulting to 0x2a30
2019-01-03 18:03:42.482989+0200 0x200      Default     0x0                  0      0    <IOPlatformPluginFamily`DebugPrint> kernel: (IOPlatformPluginFamily) Low battery threshold is not specified! Defaulting to 0x32
2019-01-03 18:03:42.482990+0200 0x200      Default     0x0                  0      0    <IOPlatformPluginFamily`DebugPrint> kernel: (IOPlatformPluginFamily) Low battery threshold is not specified! Defaulting to 0x32

Thanks for you time even reading my post.

I attach the debugging info. on the ACPI/patched I include the source .dsl files with my comments.

Thanks Again!!!!
Off-topic.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
190,989
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Hi @RehabMan ,
are You able to solve the error in my DSDT? Is a iasl bug?
Not an iasl bug. This code is nonsense:
Code:
        Store (ShiftLeft (Add (One, Local2), One, Add (One, Local2)), Local3)
Third/optional param to ShiftLeft must be an 'l-value', not 'r-value'.

Perhaps this is what was intended:
Code:
        Store (ShiftLeft (Add (One, Local2), One), Local3)
 
D

Deleted member 5764

Guest
Not an iasl bug. This code is nonsense:
Code:
        Store (ShiftLeft (Add (One, Local2), One, Add (One, Local2)), Local3)
Third/optional param to ShiftLeft must be an 'l-value', not 'r-value'.

Perhaps this is what was intended:
Code:
        Store (ShiftLeft (Add (One, Local2), One), Local3)

Thanx!
 
D

Deleted member 5764

Guest
Hi @RehabMan, I decided to update my notebook to Mojave. I followed your guide to the end, I can start but I have problems for DSDT and SSDT. Since I made changes to the Bios I wanted to extract the native DSDTs and SSDTs and redo the patches. The problem is that, as you can verify yourself, even decompiling as per your instructions I have errors on both the dsdt and SSDT 1, this ssdt I need for the battery, as my embedded control is in the ssdt1. How can I solve? How come before (less than a year ago) with the same version of Bios I did not have these errors?

P.S. you will notice that there is a dsdt and a ssdt in the patch folder, but they are old and need to be replaced, so do not consider them


EDIT: Solved myself, the solution is DECOMPILE WITH ONLY A PART OF REFS.TXT
 

Attachments

Last edited by a moderator:
D

Deleted member 5764

Guest
Not an iasl bug. This code is nonsense:
Code:
        Store (ShiftLeft (Add (One, Local2), One, Add (One, Local2)), Local3)
Third/optional param to ShiftLeft must be an 'l-value', not 'r-value'.

Perhaps this is what was intended:
Code:
        Store (ShiftLeft (Add (One, Local2), One), Local3)

What should I fix to avoid the errors you see in the kernel log?
 

Attachments

Joined
Apr 5, 2011
Messages
146
Motherboard
Asus P8P67 B3 3.0
CPU
i5-2500K
Graphics
HD 6870
Mac
MacBook Pro
Mobile Phone
Android
Hi @RehabMan. A really fast question about patching and sorry for such a basic question. In the DSDT I see various ways of how a entity is written e.g.:

Code:
Scope (_SB.PCI0.LPCB.EC0)
Store (\_SB.PCI0.LPCB.EC0.MS0T, Local0)
External (_SB_.PCI0.LPCB.EC0_.CHRG, UnknownObj) 
Scope (\_GPE) (from a SSDT)
When should I use a \ and an _ after the symbol? Is Scope (_SB.PCI0.LPCB.EC0) the same as Scope (_SB_.PCI0.LPCB.EC0), Scope (\_SB_.PCI0.LPCB.EC0) and Scope (\_SB.PCI0.LPCB.EC0)

Thanks!
 
Joined
Dec 21, 2013
Messages
13
Motherboard
ASUS ROG GL752 VW
CPU
i7 6700HQ (Skylake)
Graphics
intel hd 530+Nvidia 960 mobile
Mac
MacBook Pro
Hi guys! I've done install Mojave on my laptop but HDMI audio does not work (yet) and cannot manage how to make the keyboard backlights to work! I'll attach my patched DSDT (in .dsl mode, to be opened with MaciAsl). IS here someone with the same machine, who was managed how to turn on that stuff?
I tried these methods: AsusFnbKeys, with all methods (DSDT patch, kexts...), no luck AppleBacklightFixUp.kext and SSDT-PNLF from RehabMan (here I've done with basic screen backlight setup).
 

Attachments

Joined
Jan 4, 2019
Messages
10
Motherboard
ASUS N46VZ
CPU
i7 - 3630QM
Graphics
HD 4000 / GT 650M
Mac
MacBook
Mobile Phone
iOS
How to fix this? I'm on Ivy Bridge - Mojave

when I use without "-da" it's works, but when I use "-da", it's look like this:
Code:
Last login: Sun Jan 20 14:09:28 on console
MacBook-Pro:~ brynts$ cd /Users/brynts/Desktop/origin
MacBook-Pro:origin brynts$ iasl -da -dl DSDT.aml SSDT*.aml

Intel ACPI Component Architecture
ASL+ Optimizing Compiler version 20161210-64(RM)
Copyright (c) 2000 - 2016 Intel Corporation

Input file DSDT.aml, Length 0x13329 (78633) bytes
ACPI: DSDT 0x0000000000000000 013329 (v02 _ASUS_ Notebook 00000013 INTL 20091112)
External object resolution file SSDT-x3_3-ApCst.aml
Input file SSDT-x3_3-ApCst.aml, Length 0x119 (281) bytes
ACPI: SSDT 0x0000000000000000 000119 (v01 PmRef  ApCst    00003000 INTL 20051117)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file SSDT-x3_2-Cpu0Cst.aml
Input file SSDT-x3_2-Cpu0Cst.aml, Length 0x853 (2131) bytes
ACPI: SSDT 0x0000000000000000 000853 (v01 PmRef  Cpu0Cst  00003001 INTL 20051117)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file SSDT-x3_1-ApIst.aml
Input file SSDT-x3_1-ApIst.aml, Length 0x303 (771) bytes
ACPI: SSDT 0x0000000000000000 000303 (v01 PmRef  ApIst    00003000 INTL 20051117)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file SSDT-x3_0-CpuPm.aml
Input file SSDT-x3_0-CpuPm.aml, Length 0xA92 (2706) bytes
ACPI: SSDT 0x0000000000000000 000A92 (v01 PmRef  CpuPm    00003000 INTL 20051117)
Pass 1 parse of [SSDT]
Pass 2 parse of [SSDT]
External object resolution file SSDT-3-CpuPm.aml
Input file SSDT-3-CpuPm.aml, Length 0xA92 (2706) bytes
ACPI: SSDT 0x0000000000000000 000A92 (v01 PmRef  CpuPm    00003000 INTL 20051117)
Pass 1 parse of [SSDT]
ACPI Error: [SSDT] Namespace lookup failure, AE_ALREADY_EXISTS (20161210/dswload-462)
ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20161210/psobject-310)
Could not parse external ACPI tables, AE_ALREADY_EXISTS
MacBook-Pro:origin brynts$
 

Attachments

Last edited:
Top