Contribute
Register

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

Status
Not open for further replies.
Just grabbed a 950 Pro and adapter card and it boots fine on my GA-P55M-UD2 into Windows 10, it shows up in BIOS boot selection screen.

Still looking at how to get it to show up in Clover.

Just started looking at this thread and a user on page 1 got his 950 Pro working, so I guess I could follow this process.
Mission accomplished thanks to RehabMan!
 
...
Still looking at how to get it to show up in Clover.
Just started looking at this thread and a user on page 1 got his 950 Pro working, so I guess I could follow this process.

Let's see how we can get this to work then! Cool.

Looks like since we have newer Mac OS X now then 10.12. that was used in the early posts in this thread, things have changed and some of these hack's aren't necessary any more. I hope @RehabMan still reading here and can shed some light on this :) I think key to know is what the minimal setup is that we need to put into the clover config and drivers folder so that clover can at least bootstrap itself from the NVM.
 
Aha. This thread is overkill if using 10.13, which I am. So this will be slightly off topic, but short.

To finally get this to recognize my drive I had to get NvmExpressDxe.efi loaded.
- Clover Configurator wouldn't install it when selected - it uses a 'new' file structure and I had to add Drivers/UEFI folder to get it to download and put it on the disk.
- With that, my old version of Clover wasn't reading that folder so I copied it to several locations including drivers64 folder - (there is also drivers64UEFI, Drivers/BIOS and I added a drivers32UEFI) but you can check the boot.log and look for it to be loaded in the [ LoadDrivers ] section of the log.
- ( 25:350 0:047 Loading NvmExpressDxe.efi status=Success ) yeah
- Then I could select the drive to boot. I previously did a sector by sector copy of my SATA SSD (luckly the old drive is 500GB and the new one is 512GB so it works well) using Clonezilla - then changed the drive name to I could tell the difference.
 
Last edited:
Aha. This thread is overkill if using 10.13, which I am. So this will be slightly off topic, but short.

To finally get this to recognize my drive I had to get NvmExpressDxe.efi loaded.
- Clover Configurator wouldn't install it when selected - it uses a 'new' file structure and I had to add Drivers/UEFI folder to get it to download and put it on the disk.
...
- ( 25:350 0:047 Loading NvmExpressDxe.efi status=Success ) yeah
- Then I could select the drive to boot. I previously did a sector by sector copy of my SATA SSD (luckly the old drive is 500GB and the new one is 512GB so it works well) using Clonezilla - then changed the drive name to I could tell the difference.

@ADent - first of all - you're my hero!! I've got the first success now by doing exactly how you did:
  1. Copy NvmExpressDxe.efi to both my Clover 5033 based EFI/CLOVER/drivers64 as well as EFI/CLOVER/drivers64UEFI folder on my existing SATA drive
  2. Clone Mac OS X system partition from SATA to 950Pro using superDuper! (roughly same size of 500GB source and 512GB target)
  3. Boot Clover from the SATA drive -> it can see the 950Pro root partition and can boot into it
  4. Status is
    1. Mac OS X was booted via Clover on the SATA disk and is running Mac OS X with root drive on the 950Pro
    2. Can run BlackMagic Disk Speed Test and get roughly 1450MB/s read and 1500MB/s write speed - yay!
So far so good. It's of course desirable to be able to boot directly from the 950Pro. So far I haven't been successful, despite having taken the following steps:
  1. Copied NvmExpressDxe.efi to the same EFI folders on the 950Pro's EFI partition -> unsuccessful (shows only a forever blinking cursor during boot)
  2. Cloned the existing EFI partition from the SATA drive directly to the EFI partition on the 950Pro using command:
    • sudo dd if=/dev/disk1s1 of=/dev/disk0s1 bs=512
    • (disk1s1 was SATA partition and disk0s1 NVM)
    • -> unsuccessful during boot, same forever blinking cursor
  3. Upgraded Clover on the 950Pro EFI partition to 5122 using the installer
    • while also selecting the BiosBlockIO loader plus several driver upgrades
    • and again copying the NvmExpressDxe.efi to the appropriate locations (both BIOS and UEFI, now called drivers/BIOS and driver/UEFI)
    • -> same forever blinking cursor during boot
Worth to mention is during boot then the cursor blinks, it does so first in a smaller screen size then switches to full screen but then it stays like that forever. Looks like it switches graphics mode but then nothing else happens.

Any further hints on how to get this to boot from the NVM drive are greatly appreciated!
 
Last edited:
I am not booting directly on the PCIe mounted M.2 SSD - I am using my old SATA SSD with Clover, then selecting the PCIe drive and booting into MacOS High Sierra from there.

There was a bunch of posts on the Windows side when the 950 Pro was new using Clover to solve booting issues. I didn't see anyone boot directly into Clover with the BIOS M.2 SSDs - they would have to boot using a USB thumb drive (or other HD with Clover) into Clover, then select the M.2 SSD.

I did get Windows 10 to boot directly using the F12 select screen - the Windows installer formatted it MBR and I had to run the installer a second time to get it to work.


I would guess Chameleon might support direct booting, but I stopped using that at 10.9?

If you figure out how to boot directly into Clover, let me know.

BTW any M.2 SSD that Clover supports should work, not just the special ones that have the Option ROM that supports BIOS booting. I don't have any other ones to test. These regular NVMe drives will never boot these old machines in any OS w/o NVMe drivers in BIOS, but should be bootable from Clover with the correct drivers loaded.
 
Haven't been lucky since my last post getting clover to install on the 950pro. The only setup that works is the same like yours (boot from SATA disk and then into the NVM.e disk). It's not the greatest, especially since boot new depends on 2 things to work so it's even harder to change the setup.

I'm considering OpenCore now, but I know from experience with Clover, it takes a while and lots of suffering until everything is back stable again. I do have a week of annual leave ahead so I might give it a shot, just to see how this behaves.
 
@RehabMan
It may have more path components without ACPI identities. Likely behind a PCI bridge...
If you have an ioreg, it would be more clear.

But guessing, might be something like:
Code:
// Inject bogus class-code for NVMe SSD to prevent IONVMeFamily.kext from loading
DefinitionBlock("", "SSDT", 2, "hack", "NVMe-Pcc", 0)
{
    External(_SB.PCI0.PEG0.PEGP, DeviceObj)
    Device(_SB.PCI0.PEG0.PEGP.PCI8)
    {
        Name(_ADR, 0x00080000)
        Device(SSD0) { Name(_ADR, 0) }
    }
    Method(_SB.PCI0.PEG0.PEGP.PCI8.SSD0._DSM, 4)
    {
        If (!Arg2) { Return (Buffer() { 0x03 } ) }
        Return(Package()
        {
            "class-code", Buffer() { 0xff, 0x08, 0x01, 0x00 },
        })
    }
}
//EOF
I am trying to use the trick on my second SSD (non-system). Basically I want to use the stock IONVMeFamily kext for the system SSD and use this for PM981. The problem I am having is that half of the time this works. And if I can boot into the system, I can see one device is assigned to the stock driver and the other is assigned to the hacked driver. Everything works smoothly and no trouble at all. However, the other half the time I would get crash and reboot. The crash report is attached below. This seems to be some kind of load order issue? Is there a way to solve this using OC?

panic(cpu 1 caller 0xffffff801ba60f52): "attempting to register a sysctl at previously registered slot : 135"@/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/xnu/xnu-7195.50.7/bsd/kern/kern_newsysctl.c:242
Backtrace (CPU 1), Frame : Return Address
0xffffffa0bfa638c0 : 0xffffff801b4bc66d mach_kernel : _handle_debugger_trap + 0x3dd
0xffffffa0bfa63910 : 0xffffff801b5ff073 mach_kernel : _kdp_i386_trap + 0x143
0xffffffa0bfa63950 : 0xffffff801b5ef6aa mach_kernel : _kernel_trap + 0x55a
0xffffffa0bfa639a0 : 0xffffff801b461a2f mach_kernel : _return_from_trap + 0xff
0xffffffa0bfa639c0 : 0xffffff801b4bbf0d mach_kernel : _DebuggerTrapWithState + 0xad
0xffffffa0bfa63ae0 : 0xffffff801b4bc1f8 mach_kernel : _panic_trap_to_debugger + 0x268
0xffffffa0bfa63b50 : 0xffffff801bcbee1a mach_kernel : _panic + 0x54
0xffffffa0bfa63bc0 : 0xffffff801ba60f52 mach_kernel : _sysctl_register_oid + 0x122
0xffffffa0bfa63bf0 : 0xffffff801f821605 com.apple.hack.HackrNVMeFamily : __ZN11NVMeGlobalsC2Ev + 0x47
0xffffffa0bfa63c10 : 0xffffff801bba28dc mach_kernel : _OSRuntimeInitializeCPP + 0x66c
0xffffffa0bfa63c80 : 0xffffff801bba2396 mach_kernel : _OSRuntimeInitializeCPP + 0x126
0xffffffa0bfa63cf0 : 0xffffff801bb86b32 mach_kernel : __ZN6OSKext5startEb + 0x182
0xffffffa0bfa63d40 : 0xffffff801bb8413c mach_kernel : __ZN6OSKext4loadEhhP7OSArray + 0xdc
0xffffffa0bfa63da0 : 0xffffff801bb989dd mach_kernel : __ZN6OSKext22loadKextWithIdentifierEP8OSStringPP8OSObjectbbhhP7OSArray + 0x1ad
0xffffffa0bfa63df0 : 0xffffff801bc0eebe mach_kernel : __ZNK11IOCatalogue14isModuleLoadedEP12OSDictionaryPP8OSObject + 0xee
0xffffffa0bfa63e40 : 0xffffff801bbee39b mach_kernel : __ZN9IOService15probeCandidatesEP12OSOrderedSet + 0x43b
0xffffffa0bfa63ef0 : 0xffffff801bbeddcf mach_kernel : __ZN9IOService14doServiceMatchEj + 0x30f
0xffffffa0bfa63f50 : 0xffffff801bbf0b46 mach_kernel : __ZN15_IOConfigThread4mainEPvi + 0x186
0xffffffa0bfa63fa0 : 0xffffff801b46113e mach_kernel : _call_continuation + 0x2e
Kernel Extensions in backtrace:
com.apple.hack.HackrNVMeFamily(92.1)[12D4270E-AFFC-34DC-9714-44D1FE33333F]@0xffffff801f821000->0xffffff801f860fff
dependency: com.apple.driver.AppleEFINVRAM(2.1)[78808055-9D80-3318-8BEE-4C545178A586]@0xffffff801c855000->0xffffff801c85efff
dependency: com.apple.driver.AppleMobileFileIntegrity(1.0.5)[37AC6FB3-4CB3-3E1A-981C-48A212712E57]@0xffffff801c9fc000->0xffffff801ca10fff
dependency: com.apple.iokit.IOPCIFamily(2.9)[A18ACD60-A811-3624-B50D-4F929836EE79]@0xffffff801de17000->0xffffff801de3efff
dependency: com.apple.iokit.IOReportFamily(47)[0EC55CCD-966C-33F4-9B8A-1E9CB2778AE7]@0xffffff801de4d000->0xffffff801de4ffff
dependency: com.apple.iokit.IOStorageFamily(2.1)[3FE3BE82-782C-3D93-8EFA-F06A4594D17C]@0xffffff801df37000->0xffffff801df48fff

Process name corresponding to current thread: kernel_task
Boot args: batman=0xff keepsyms=1 debug=0x12a acpi_layer=0x8 acpi_level=0x2 msgbuf=309212 -liludbg -nvmefdbg chunklist-security-epoch=0 -chunklist-no-rev2-dev

Mac OS version:
20B29

Kernel version:
Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:11 PDT 2020; root:xnu-7195.50.7~2/RELEASE_X86_64
Kernel UUID: 84C6DC45-6B02-335F-9439-5D2A9BC385A4
KernelCache slide: 0x000000001b200000
KernelCache base: 0xffffff801b400000
Kernel slide: 0x000000001b210000
Kernel text base: 0xffffff801b410000
__HIB text base: 0xffffff801b300000
System model name: MacBookPro14,1 (Mac-B4831CEBD52A0C4C)
System shutdown begun: NO
Panic diags file available: NO (0xe00002d8)
Hibernation exit count: 0

System uptime in nanoseconds: 2892791123
Last Sleep: absolute base_tsc base_nano
Uptime : 0x00000000ac6c844a
Sleep : 0x0000000000000000 0x0000000000000000 0x0000000000000000
Wake : 0x0000000000000000 0x0000000cf7b7c5b4 0x0000000000000000
 
@grassmudhorse, This thread is no longer appropriate for macOS newer than High Sierra 10.12.6.
 
Status
Not open for further replies.
Back
Top