Contribute
Register

[Guide] HackrNVMeFamily co-existence with IONVMeFamily using class-code spoof

Status
Not open for further replies.
This EFI/Clover does not correspond to the ioreg you provided previously.

This EFI/Clover has two *.aml files in ACPI/patched:
SSDT-i7-6700K.aml
SSDT-NVMe-Pcc.aml

But your Clover bootlog (extracted from ioreg) shows only one loading:
Code:
17:029  0:000  Start: Processing Patched AML(s): Unsorted
17:029  0:000  Inserting SSDT-NVMe-Pcc.aml from EFI\CLOVER\ACPI\patched ... Success
17:033  0:003  End: Processing Patched AML(s)

Need files that are consistent with respect to each other...
I, too, want to see if my two SSDTs are loading. I looked in ioreg app and didn't see the above information; same with the Console app. Where/how can I find this Clover Bootlog information? TIA.
 
I, too, want to see if my two SSDTs are loading. I looked in ioreg app and didn't see the above information; same with the Console app. Where/how can I find this Clover Bootlog information? TIA.

You can find out which SSDTs Clover is loading by looking at your Clover bootlog.
For example, you can look at Clover bootlog in Terminal with bdmesg and grep:
Code:
bdmesg|grep -y aml

For example, output on my NUCi7KYK:
Code:
SPEEDY-NUC:probook.git rehabman$ bdmesg|grep aml
2:890  0:000  Inserting SSDT_NVMe-Pcc.aml from EFI\CLOVER\ACPI\patched ... Success
2:892  0:001  Inserting SSDT_RMNE.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:001  Inserting SSDT.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:000  Inserting SSDT-HDAU.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:000  Inserting SSDT-HDEF.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:000  Inserting SSDT-NUCHDA.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:000  Inserting SSDT-SATA.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:000  Inserting SSDT-XHC.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:000  Inserting SSDT-Disable_EHCI.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:000  Inserting SSDT-USB.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:000  Inserting SSDT-IGPU.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:000  Inserting SSDT-LPC.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:000  Inserting SSDT-XOSI.aml from EFI\CLOVER\ACPI\patched ... Success
2:893  0:000  Inserting SSDT-Config-SC.aml from EFI\CLOVER\ACPI\patched ... Success

When someone reports "Problem Reporting" files, I extract from ioreg.
The actual Clover bootlog is stored in ioreg at IODeviceTree:/efi/platform, property 'boot-log' (bdmesg retrieves that data and writes it to stdout)
The data there is the bytes (displayed in hex by IORegistryExplorer) that make up the ASCII bootlog.
 
You can find out which SSDTs Clover is loading by looking at your Clover bootlog.
For example, you can look at Clover bootlog in Terminal with bdmesg and grep:
Code:
bdmesg|grep -y aml
...
When someone reports "Problem Reporting" files, I extract from ioreg.
The actual Clover bootlog is stored in ioreg at IODeviceTree:/efi/platform, property 'boot-log' (bdmesg retrieves that data and writes it to stdout)
The data there is the bytes (displayed in hex by IORegistryExplorer) that make up the ASCII bootlog.
Thank you, RehabMan! A very useful check. I'll put this info in my build descriptions and guides. I might even put it in the Terminal's .profile. :thumbup:
 
Hello @RehabMan - firstly, let me just say thank you for all your help in this community. I'm a complete noob but its evident how much time you put in to help making these things work.

I have followed your instructions, but got a kernel panic, so I tried something else. Could you check it out?

I'm on a ASRock Z170 itx on macOS Sierra 10.12.3

This is what I did:
1. Followed post #1
a. Github - downloaded your repo on my new hackintosh
b. ACPI Path - used IOReg (part of X-code which I was able to download separately) to find my ACPI Path
NVMe ACPI Path.png
which I interpreted into the format according to your Windows examples
NVMe ACPI Path Interpreted.png
c. SSDT - Created the SSDT-NVMe-Pcc.aml based on the ACPI path (attached) and put into into my hackintosh system's EFI/Clover/ACPI/patched/
d. _DSM - Changed _DSM to XDSM. I couldn't really comprehend what you wrote, and I have no idea if my "OEM already defined a _DSM method" and couldn't find any of that info in IOReg, so I just did it anyway. I added this code to my config.plist file under DSDT Patches:
Code:
<dict>[/INDENT]
                    <key>Comment</key>
                    <string>change _DSM to XDSM</string>
                    <key>Find</key>
                    <data>X0RTTQ==</data>
                    <key>Replace</key>
                    <data>WERTTQ==</data>
         </dict>```[/INDENT]
e. HackrNVMeFamily*.kext - created this kext with the spoofed class code by typing ./patch_nvme.sh --spoof 10_12_3 into terminal and I installed with KextBeast into S/L/E (because thats where my IONVMeFamily.kext is).
f. Cache - the cache was built without any error.
2. In my config.plist file I removed the old patches for IONVMeFamily.kext because on Github you said to do so:
"You should also make sure you have no patches for IONVMeFamily.kext in your config.plist before trying to use the patched kext."

3. I didn't remove IONVMeFamily.kext because you said:
"With this technique, HackrNVMeFamily and IONVMeFamily can co-exist. Applies to installation scenarios and to post-install."
But I did remove IONVMeFamily.kext from EFI/CLOVER/kexts/Other​

Then I restart my computer.

Kernel panic! Crash!


Oh dear. So I booted with another USB boot loader I had made (with IONVMeFamily.kext before implementing this patch). It got stuck on a part when it said Legacy HD2 Shim

Then I made these changes:

4.
I added the code from NVMe_patches_10_12_3.plist: KextsToPatch content for 10.12.3 (16D32) on your Github repo into my config.plist on my hackintosh system's file. (Where in step 2 I had removed all the IONVMe stuff).

VIOLA! Now we are booting again :) Phew!

So..... my big question is.... have I actually done this patch? Did I make the changes like I'm supposed to? :)

I've attached all the files as you have indicated in post #1.




Related Questions

A.
I have no idea what "vanilla" means. From everything I have read I means, "plain" or "original", but I still can't get my head around when you said on your Github...
  • /System/Library/Extensions/IONVMeFamily.kext must be vanilla
Does that mean it has to be new? To be untouched? I'm confused, would I have touched it at some point? How do I make sure its "vanilla"?

B. Can I now use this NVMe as a Fusion drive with my HDD, and create one by booting into the Recovery Partition? (The Apple Fusion Drive)

 

Attachments

  • CLOVER.zip
    1.8 MB · Views: 74
  • SSDT-NVMe-Pcc.aml
    134 bytes · Views: 107
Hello @RehabMan - firstly, let me just say thank you for all your help in this community. I'm a complete noob but its evident how much time you put in to help making these things work.

I have followed your instructions, but got a kernel panic, so I tried something else. Could you check it out?

I'm on a ASRock Z170 itx on macOS Sierra 10.12.3

This is what I did:
1. Followed post #1
a. Github - downloaded your repo on my new hackintosh
b. ACPI Path - used IOReg (part of X-code which I was able to download separately) to find my ACPI Path
View attachment 236275
which I interpreted into the format according to your Windows examples
View attachment 236276
c. SSDT - Created the SSDT-NVMe-Pcc.aml based on the ACPI path (attached) and put into into my hackintosh system's EFI/Clover/ACPI/patched/
d. _DSM - Changed _DSM to XDSM. I couldn't really comprehend what you wrote, and I have no idea if my "OEM already defined a _DSM method" and couldn't find any of that info in IOReg, so I just did it anyway. I added this code to my config.plist file under DSDT Patches:
Code:
<dict>[/INDENT]
                    <key>Comment</key>
                    <string>change _DSM to XDSM</string>
                    <key>Find</key>
                    <data>X0RTTQ==</data>
                    <key>Replace</key>
                    <data>WERTTQ==</data>
         </dict>```[/INDENT]
e. HackrNVMeFamily*.kext - created this kext with the spoofed class code by typing ./patch_nvme.sh --spoof 10_12_3 into terminal and I installed with KextBeast into S/L/E (because thats where my IONVMeFamily.kext is).
f. Cache - the cache was built without any error.
2. In my config.plist file I removed the old patches for IONVMeFamily.kext because on Github you said to do so:
"You should also make sure you have no patches for IONVMeFamily.kext in your config.plist before trying to use the patched kext."
3. I didn't remove IONVMeFamily.kext because you said:
"With this technique, HackrNVMeFamily and IONVMeFamily can co-exist. Applies to installation scenarios and to post-install."
But I did remove IONVMeFamily.kext from EFI/CLOVER/kexts/Other​
Then I restart my computer.

Kernel panic! Crash!


Oh dear. So I booted with another USB boot loader I had made (with IONVMeFamily.kext before implementing this patch). It got stuck on a part when it said Legacy HD2 Shim

Then I made these changes:

4.
I added the code from NVMe_patches_10_12_3.plist: KextsToPatch content for 10.12.3 (16D32) on your Github repo into my config.plist on my hackintosh system's file. (Where in step 2 I had removed all the IONVMe stuff).

VIOLA! Now we are booting again :) Phew!

So..... my big question is.... have I actually done this patch? Did I make the changes like I'm supposed to? :)

I've attached all the files as you have indicated in post #1.




Related Questions

A.
I have no idea what "vanilla" means. From everything I have read I means, "plain" or "original", but I still can't get my head around when you said on your Github...
  • /System/Library/Extensions/IONVMeFamily.kext must be vanilla
Does that mean it has to be new? To be untouched? I'm confused, would I have touched it at some point? How do I make sure its "vanilla"?

B. Can I now use this NVMe as a Fusion drive with my HDD, and create one by booting into the Recovery Partition? (The Apple Fusion Drive)


Your config.plist is corrupt. Only use a plist editor to edit your config.plist, never a text editor.
You should have no patches for IONVMeFamily in your config.plist.
SSDT-NVMe-Pcc.aml is not present in ACPI/patched.
 
Your config.plist is corrupt. Only use a plist editor to edit your config.plist, never a text editor.
You should have no patches for IONVMeFamily in your config.plist.
SSDT-NVMe-Pcc.aml is not present in ACPI/patched.

Ah thank you! I rebuilt the config.plist... and I removed the IONVMeFamily Patches. But IONVMeFamily.kext still lives alongside HackrNVMeFamily.kext in S/L/E. I think its working now, right?!?! :) :)

And yes, I noticed the AML was not there. I have added it back in. Thank you!

=============================================

Could you poss help me answer the last two questions? Sorry if they seem obvies.

Related Questions

A.
I have no idea what "vanilla" means. From everything I have read I means, "plain" or "original", but I still can't get my head around when you said on your Github...
  • /System/Library/Extensions/IONVMeFamily.kext must be vanilla
Does that mean it has to be new? To be untouched? I'm confused, would I have touched it at some point? How do I make sure its "vanilla"?

B. Can I now use this NVMe as a Fusion drive with my HDD, and create one by booting into the Recovery Partition? (The Apple Fusion Drive)
 

Attachments

  • CLOVER.zip
    1.7 MB · Views: 85
Ah thank you! I rebuilt the config.plist... and I removed the IONVMeFamily Patches. But IONVMeFamily.kext still lives alongside HackrNVMeFamily.kext in S/L/E. I think its working now, right?!?! :) :)


Must be.

Could you poss help me answer the last two questions? Sorry if they seem obvies.

A. vanilla means untouched since the macOS/OS X installer put it there
B. I've never done a Fusion setup. IMHO, Fusion would defeat the purpose of NVMe.
 
I have a shiny Samsung 960 EVO NVMe drive wich is not showing up either in BIOS, System Utility or System Information.

My System:
ASUS X99A-ii (Latest BIOS 1401)
INTEL i7 6900X
Samsung 850 EVO ( Sierra 10.12.3 following kgp's great guide with Clover 4003 )

I followed your guide on GitHub:

1. Downloaded your repo
2. backed my IONVMeFamily.kext from SLE
3. created a HackrNVMeFamily-10_12_3.kext
4. copied HackrNVMeFamily-10_12_3.kext to EFI/CLOVER/kext10.12
5. spoofed the IONVMeFamily.kext
6. added NVMe_patches_10_12_3.plist array to my config.plist

Still not showing up. I think im missing some fundamental step.
Any help appreciated!

edit: installing windows to find the ACPI path...
 
Last edited:
I have a shiny Samsung 960 EVO NVMe drive wich is not showing up either in BIOS, System Utility or System Information.

My System:
ASUS X99A-ii (Latest BIOS 1401)
INTEL i7 6900X
Samsung 850 EVO ( Sierra 10.12.3 following kgp's great guide with Clover 4003 )

I followed your guide on GitHub:

1. Downloaded your repo
2. backed my IONVMeFamily.kext from SLE
3. created a HackrNVMeFamily-10_12_3.kext
4. copied HackrNVMeFamily-10_12_3.kext to EFI/CLOVER/kext10.12
5. spoofed the IONVMeFamily.kext
6. added NVMe_patches_10_12_3.plist array to my config.plist

Still not showing up. I think im missing some fundamental step.
Any help appreciated!

edit: installing windows to find the ACPI path...

If it is not showing in BIOS, then you have a hardware or hardware installation issue.
As far as your procedures, you're doing it wrong. Read post #1.
 
ok, second attempt:

1. I installed Windows 10. (960 EVO is now listed in BIOS)
2. Got the ACPI path: _SB.PCI0.BR1B.H000
3. Created SSDT-NVMe-Pcc.aml and copied to EFI/Clover/ACPI/patched
Code:
// Inject bogus class-code for NVMe SSD to prevent IONVMeFamily.kext from loading
DefinitionBlock("", "SSDT", 2, "hack", "NVMe-Pcc", 0)
{
    External(_SB.PCI0.BR1B.PXSX, DeviceObj)
    Method(_SB.PCI0.BR1B.PXSX._DSM, 4)
    {
        If (!Arg2) { Return (Buffer() { 0x03 } ) }
        Return(Package()
        {
            "class-code", Buffer() { 0xff, 0x08, 0x01, 0x00 },
            "built-in", Buffer() { 0 },
        })
    }
}
//EOF

Tried 10.11.x fix for 960 as well
Code:
/ Inject bogus class-code for NVMe SSD to prevent IONVMeFamily.kext from loading
// also inject "compatible", "IOName", and "name" such that 10.11.x IONVMeFamily
// does not match on pci144d,a804 (Samsung 960 EVO)
DefinitionBlock("", "SSDT", 2, "hack", "NVMe-Pcc", 0)
{
    External(_SB.PCI0.BR1B.PXSX, DeviceObj)
    Method(_SB.PCI0.BR1B.PXSX._DSM, 4)
    {
        If (!Arg2) { Return (Buffer() { 0x03 } ) }
        Return(Package()
        {
            "class-code", Buffer() { 0xff, 0x08, 0x01, 0x00 },
            "built-in", Buffer() { 0 },
            "compatible", Buffer() { "pci144d,a801" },
            "IOName", "pci144d,a801",
            "name", Buffer() { "pci144d,a801" },
        })
    }
}
//EOF
4. created HackrNVMeFamily-10_12_3.kext and copied to EFI/Clover/ACPI/patched
Code:
cd ~/Downloads/patch-nvme-master
./patch_nvme.sh --spoof 10_12_3
5. Added OSI and DSM rename in config.plist
Code:
<key>Patches</key>
            <array>
                <dict>
                    <key>Comment</key>
                    <string>change _OSI to XOSI</string>
                    <key>Disabled</key>
                    <false/>
                    <key>Find</key>
                    <data>
                    X09TSQ==
                    </data>
                    <key>Replace</key>
                    <data>
                    WE9TSQ==
                    </data>
                </dict>
                <dict>
                    <key>Comment</key>
                    <string>change _DSM to XDSM</string>
                    <key>Find</key>
                    <data>
                    lXmDcw==
                    </data>
                    <key>Replace</key>
                    <data>
                    WERTTQ==
                    </data>
                </dict>
            </array>


SSD still not showing up in System Utility or System Information.

I am lost...



 

Attachments

  • CLOVER.zip
    3.9 MB · Views: 83
Status
Not open for further replies.
Back
Top