Jump to content

Patch for using NVMe under macOS Sierra is ready.


1,382 posts in this topic

Recommended Posts

Attached is the script (and supporting files) to create a patched kext that can be used without modifying or deleting existing vanilla IONVMeFamily.kext.

 

Contents:

binpatch: pre-built utility to patch binary files using a simple command line.

binpatch.c: source for binpatch binary

NVMe_patches_10_11_5.plist: KextsToPatch content as provided by Mork vom Ork, post #33 this thread.

NVMe_patches_10_11_6_beta4.plist: KextsToPatch content as provided by Mork vom Ork, post #16 this thread.

NVMe_patches_10_12_dp1.plist: KextsToPatch content as provided by Mork vom Ork, post #8 this thread.

patch_nvme.sh: main patching script

 

Usage:

- extract patch_nvme.zip archive

- cd to the extracted location

- execute patch_nvme.sh with argument that corresponds to the plist you wish to patch with

- the script creates the patched kext in the current directory

- you must run the script with the parameter that corresponds to the version of OS X you are running

- /System/Library/Extensions/IONVMeFamily.kext must be vanilla

 

For example, if you are running 10.11.5, to create a patched 10.11.5 kext:

# assuming downloaded and extracted to ~/Downloads/patch_nvme
cd ~/Downloads/patch_nvme
./patch_nvme.sh 10_11_5
The result is HackrNVMeFamily-10_11_5.kext. You can install it to /S/L/E, /L/E, or use Clover kext injection with it. It will not interfere with IONVMeFamily.kext and system updates will not change it.

 

Similarly, you would use './patch_nvme.sh 10_12_dp1' or './patch_nvme.sh 10_11_6_beta4' to patch based on the other plist files. Of course, you need to be running the version of OS X that corresponds to the plist you're patching with as the script relies on getting vanilla IONVMeFamily.kext from /S/L/E.

 

You should also make sure you have no patches for IONVMeFamily.kext in your config.plist before trying to use the patched kext.

 

attachicon.gifpatch_nvme.zip

 

Note: The patch assumes Samsung 950 Pro NVMe. You will see the device-id coded in the script... Change it to match the device-id of your NVMe controller.

 

 

Worked like a charm!

 

It is the first solution working with my Zotac Sonix PCIe 480GB! 

 

Used device id (got it from DPCIManager):

devid=pci1987,5007

  • Like 1
Link to comment
Share on other sites

Worked like a charm!

 

It is the first solution working with my Zotac Sonix PCIe 480GB! 

 

Used device id (got it from DPCIManager):

devid=pci1987,5007

What is the class-code for the device as shown in ioreg?

Link to comment
Share on other sites

@nmano Too Much in the DSDT patched. AHCI is wrong.

You mean remove DSDT patched.OR

Do you have any patches?

I have this model

 

Samsung SM951 256GB AHCI MZHPV256HDGL-00000 M.2 80mm PCIe 3.0 x4 SSD - OEM
Link to comment
Share on other sites

 

You mean remove DSDT patched.OR

Do you have any patches?

I have this model

 

Samsung SM951 256GB AHCI MZHPV256HDGL-00000 M.2 80mm PCIe 3.0 x4 SSD - OEM

 

There is a difference between AHCI and NVMe

Screen Shot 2016-07-04 at 20.26.10.png

See, the topic is about NVMe

  • Like 1
Link to comment
Share on other sites

What is the class-code for the device as shown in ioreg?

 

here is the entry:

 

    | |   |           +-o ZTSSDPG3-480G-GE Media  <class IORegistryEntry:IOService:IOStorage:IOMedia, id 0x10000030e, registered, matched, active, busy 0 (29 ms), retain 11>

Link to comment
Share on other sites

here is the entry:

 

    | |   |           +-o ZTSSDPG3-480G-GE Media  <class IORegistryEntry:IOService:IOStorage:IOMedia, id 0x10000030e, registered, matched, active, busy 0 (29 ms), retain 11>

 

No. Need "class-code" property at PCI node. If it is NVMe 1.0e compliant, it will likely be class-code=<02 08 01 00>.

Link to comment
Share on other sites

Attached is the script (and supporting files) to create a patched kext that can be used without modifying or deleting existing vanilla IONVMeFamily.kext.

 

...

Note 2: The original attachment found here is the first version. Since then, I've moved the script and supporting files to github. The new version at github uses IOPCIClassMatch to match against the well-known NVMe PCI class code, so it is not necessary to supply the vendor/device-id for IONameMatch.

 

github repo: https://github.com/RehabMan/patch-nvme

Project moved to github (and updated).

  • Like 3
Link to comment
Share on other sites

im using genericNVME kext in clover which boot up my 512GB Samsung drive with no issues under 10.11, the drive is plugged to PCI adapter

getting read speed of 2000+ and write speed at 1500+

if using on M.2 slot speed reduce to SATA 3 e.g. 500r/w


Got news here:

 

the patch you will find in Post#16 is only for users, who already use OS X 10.11.6 beta 4 !!!!

 

The patch for people, who are still running on OS X 10.11.5 will have to patch their CLOVER config.plist with the following code snippets:

            <dict>
                <key>Comment</key>
                <string>NVMe SSD IONameMatch</string>
                <key>Disabled</key>
                <false/>
                <key>Name</key>
                <string>IONVMeFamily</string>
                <key>InfoPlistPatch</key>
                <true/>
                <key>Find</key>
                <data>PHN0cmluZz5wY2kxNDRkLGE4MDQ8L3N0cmluZz4=</data>
                <key>Replace</key>
                <data>PHN0cmluZz5wY2kxNDRkLGE4MDI8L3N0cmluZz4=</data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>IONVMeFamily Pike R. Alpha Patch#01</string>
                <key>Disabled</key>
                <false/>
                <key>Name</key>
                <string>IONVMeFamily</string>
                <key>Find</key>
                <data>SYnGTYX2dGFBwecMSWP/viAAAAA=</data>
                <key>Replace</key>
                <data>SYnGTYX2dGFBwecJSWP/viAAAAA=</data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>IONVMeFamily Pike R. Alpha Patch#02-03</string>
                <key>Disabled</key>
                <false/>
                <key>Name</key>
                <string>IONVMeFamily</string>
                <key>Find</key>
                <data>toyIggAAAIP5DHVYQceGpAAAAAAQAABIi0gISYmOqAA=</data>
                <key>Replace</key>
                <data>toyIggAAAIP5CXVYQceGpAAAAAACAABIi0gISYmOqAA=</data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>IONVMeFamily Pike R. Alpha Patch#04</string>
                <key>Disabled</key>
                <false/>
                <key>Name</key>
                <string>IONVMeFamily</string>
                <key>Find</key>
                <data>SI2G/w8AAEjB6AwPtw+B4f8PAAA=</data>
                <key>Replace</key>
                <data>SI2G/w8AAEjB6AkPtw+B4f8PAAA=</data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>IONVMeFamily Pike R. Alpha Patch#05 - 06</string>
                <key>Disabled</key>
                <false/>
                <key>Name</key>
                <string>IONVMeFamily</string>
                <key>Find</key>
                <data>6EiJxkiB5v8PAABIAdZIgf7/DwAAdzxIjTUCsQ==</data>
                <key>Replace</key>
                <data>6EiJxkiB5v8BAABIAdZIgf7/AQAAdzxIjTUCsQ==</data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>IONVMeFamily Pike R. Alpha Patch#07</string>
                <key>Disabled</key>
                <false/>
                <key>Name</key>
                <string>IONVMeFamily</string>
                <key>Find</key>
                <data>SYHG/w8AAEnB7gxJi00ASInLSIE=</data>
                <key>Replace</key>
                <data>SYHG/w8AAEnB7glJi00ASInLSIE=</data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>IONVMeFamily Pike R. Alpha Patch#08 - 09</string>
                <key>Disabled</key>
                <false/>
                <key>Name</key>
                <string>IONVMeFamily</string>
                <key>Find</key>
                <data>Ag+FuAAAAEyNoQAQAABMieBIJQDw//9JiY8iAQAASYmHKgEAAEG+ABAAAEkp3kiNHXOvAA==</data>
                <key>Replace</key>
                <data>Ag+FuAAAAEyNoQACAABMieBIJQDw//9JiY8iAQAASYmHKgEAAEG+AAIAAEkp3kiNHXOvAA==</data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>IONVMeFamily Pike R. Alpha Patch#10</string>
                <key>Disabled</key>
                <false/>
                <key>Name</key>
                <string>IONVMeFamily</string>
                <key>Find</key>
                <data>AABJiYcqAQAAugAQAABIKdpMjRU=</data>
                <key>Replace</key>
                <data>AABJiYcqAQAAugACAABIKdpMjRU=</data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>IONVMeFamily Pike R. Alpha Patch#11</string>
                <key>Disabled</key>
                <false/>
                <key>Name</key>
                <string>IONVMeFamily</string>
                <key>Find</key>
                <data>i6fQAAAASSnUuAAQAABNi20ASQE=</data>
                <key>Replace</key>
                <data>i6fQAAAASSnUuAACAABNi20ASQE=</data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>IONVMeFamily Pike R. Alpha Patch#12 - 13 - 14</string>
                <key>Disabled</key>
                <false/>
                <key>Name</key>
                <string>IONVMeFamily</string>
                <key>Find</key>
                <data>gEAVBk2J17oAEAAARTHJSIne6AAAAABNifpMi33QSYuHYAEAAEyJbNj4SYHFABAAAEmBxADw//9I/8NBOd4PhTn///8xwEiDxBhbQVxBXUFeQV9dw5BVSInlQVdBVlNIg+wYSYn2SYn/SYsGSInBSIHh/w8AALsAEAAASCnLSYuPyAAAAEgB2UiJTeBJiYciAQAASI0N2qwAAPYBBHQqSIsNHmMAAPcB9////3QbSYnAScHoIInBv4BAFQYx9kUxyUiJ2ugAAAAASYuP0AAAADHASDnLc0RJiwZIAcNJiZ9wAQAASIHB/w8AAEjB6Qxmqf8PD5XAD7Y=</data>
                <key>Replace</key>
                <data>gEAVBk2J17oAAgAARTHJSIne6AAAAABNifpMi33QSYuHYAEAAEyJbNj4SYHFAAIAAEmBxADw//9I/8NBOd4PhTn///8xwEiDxBhbQVxBXUFeQV9dw5BVSInlQVdBVlNIg+wYSYn2SYn/SYsGSInBSIHh/w8AALsAEAAASCnLSYuPyAAAAEgB2UiJTeBJiYciAQAASI0N2qwAAPYBBHQqSIsNHmMAAPcB9////3QbSYnAScHoIInBv4BAFQYx9kUxyUiJ2ugAAAAASYuP0AAAADHASDnLc0RJiwZIAcNJiZ9wAQAASIHB/w8AAEjB6Qlmqf8PD5XAD7Y=</data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>IONVMeFamily Pike R. Alpha Patch#15 - 16 - 17 - 18 - 19</string>
                <key>Disabled</key>
                <false/>
                <key>Name</key>
                <string>IONVMeFamily</string>
                <key>Find</key>
                <data>RQ+2wEGD+Ad3bUSKVRBED7efsAAAAEHB4xAPtoe2AAAAg+AIweAKRAnYg8gCiYcKAQAAibcOAQAASImXMgEAAIqHtgAAACQCD7bAweAdCciJhzoBAABBweAIQQ+2wUQJwInBgckAEAAARYTSD0TIiY8+AQAAMcBdw5BVSInlU7jCAgDg</data>
                <key>Replace</key>
                <data>RQ+2wEGD+Ad3bUQPtlUQRA+3n7AAAABBweMQD7aHtgAAAIPgCMHgCkQJ2IPIAomHCgEAAIm3DgEAAEiJlzIBAACKh7YAAAAkAg+2wMHgHQnIiYc6AQAAQcHgCEEPtsHB4AmQkJCQkJCQRAnARAnQiYc+AQAAMcBdw5BVSInlU7jCAgDg</data>
            </dict>

So once again: this patch here is for OS X 10.11.5

 

The patch posted in Post#16 is for OS X 10.11.6beta4

 

That was because i already update my EL CAPITAN to 10.11.6 beta and was using the IONVMeFamily.kext of OS X 10.11.6 beta 4 to make the patch for EL CAPITAN.

The patch for CLOVER you will see in this post here is the right one for OS X 10.11.5 now.

 

Sorry folks, but i thought nothing was changed in the IONVMeFamily.kext between 10.11.5 and 10.11.6 beta 4

thank Mork!

will try this, for clover patch i need to add this to plist manually?

how to add it with clover configuration? i dont have much knowledge in this...

Thanks!

Link to comment
Share on other sites

There is a difference between AHCI and NVMe

attachicon.gifScreen Shot 2016-07-04 at 20.26.10.png

See, the topic is about NVMe

Thanks Slice

Very good explanation.

Link to comment
Share on other sites

Evan that the NVMe patch from SIERRA DP1 is working on DP2, too - there are a lot of changes in the code of the binary. And when i say "a lot" - i mean "A LOT". when i compare the bin of DP1 with DP2 (w/o pikes modifys) there are about 600 changes in the code. So it seems, that they improved the code. But never the less - plist-patch for DP1 still enables NVMe on DP2 for me.

 

But we may use the patch with CAUTION.

Link to comment
Share on other sites

Evan that the NVMe patch from SIERRA DP1 is working on DP2, too - there are a lot of changes in the code of the binary. And when i say "a lot" - i mean "A LOT". when i compare the bin of DP1 with DP2 (w/o pikes modifys) there are about 600 changes in the code. So it seems, that they improved the code. But never the less - plist-patch for DP1 still enables NVMe on DP2 for me.

 

But we may use the patch with CAUTION.

Should verify that all patches Find pattern is still found in the binary...

Link to comment
Share on other sites

Should verify that all patches Find pattern is still found in the binary...

will do so after EM Match between Portugal and Wales  ;-)

 

EDIT: just checked, and ALL code patterns have been found in unmodified IONVMeFamily.kext bin file! So if there is not more to patch within this build, it should work as it does within DP1.

Link to comment
Share on other sites

will do so after EM Match between Portugal and Wales  ;-)

Similarly... waiting on the recent code churn with KextsToPatch gets sorted out :-)

Link to comment
Share on other sites

No. Need "class-code" property at PCI node. If it is NVMe 1.0e compliant, it will likely be class-code=<02 08 01 00>.

 

How do i get this class-code? Cant find anything. This is the output i'm generating with ioreg right now:

$ ioreg |grep -B 10 ZTSSD
    | |   |       |       +-o AppleUSB20XHCIPort@00100000  <class AppleUSB20XHCIPort, id 0x100000335, registered, matched, active, busy 0 (0 ms), retain 10>
    | |   |       |       +-o AppleUSB20XHCIPort@00200000  <class AppleUSB20XHCIPort, id 0x100000336, registered, matched, active, busy 0 (0 ms), retain 10>
    | |   |       +-o pci-bridge@4  <class IOPCIDevice, id 0x100000277, registered, matched, active, busy 0 (2 ms), retain 10>
    | |   |         +-o IOPP  <class IOPCI2PCIBridge, id 0x1000002f5, registered, matched, active, busy 0 (0 ms), retain 6>
    | |   +-o RP09@1D  <class IOPCIDevice, id 0x1000001fc, registered, matched, active, busy 0 (31 ms), retain 11>
    | |   | +-o IOPP  <class IOPCI2PCIBridge, id 0x100000295, registered, matched, active, busy 0 (24 ms), retain 8>
    | |   |   +-o PXSX@0  <class IOPCIDevice, id 0x1000001fd, registered, matched, active, busy 0 (24 ms), retain 12>
    | |   |     +-o HackrNVMeController  <class HackrNVMeController, id 0x1000002c0, registered, matched, active, busy 0 (3 ms), retain 11>
    | |   |       +-o IONVMeBlockStorageDevice@1  <class IONVMeBlockStorageDevice, id 0x1000002f0, registered, matched, active, busy 0 (3 ms), retain 13>
    | |   |         +-o IOBlockStorageDriver  <class IOBlockStorageDriver, id 0x1000002fe, registered, matched, active, busy 0 (2 ms), retain 8>
    | |   |           +-o ZTSSDPG3-480G-GE Media  <class IOMedia, id 0x100000301, registered, matched, active, busy 0 (2 ms), retain 11>

Link to comment
Share on other sites

 Share

×
×
  • Create New...