Jump to content
Mork vom Ork

Patch for using NVMe under macOS Sierra is ready.

1,362 posts in this topic

Recommended Posts

We need a debug kext from a beta version of macOS (I believe the 10.12.4 one would do as well).

With some additional kexts you can get the 10.12 one *loading* but for reasons unknown it does not fully work on 10.11.

 

Anyway. I began work on an open source NVMe driver that would be a lot easier to use for everybody, (NVMe is supposed to be universal after all, it's a standardized protocol), but right now I'm not sure that I can work on it very much in the short term, although I wish to.

@jsl  I'm curious now, you say you have the Plextor M8Pe working under 10.11? Can you confirm this?

Good job !

Sorry. Actually I don't have a NVMe disk and thus I have no need to mess up with this...

Share this post


Link to post
Share on other sites
Advertisement

We need a debug kext from a beta version of macOS (I believe the 10.12.4 one would do as well).

With some additional kexts you can get the 10.12 one *loading* but for reasons unknown it does not fully work on 10.11.

 

Anyway. I began work on an open source NVMe driver that would be a lot easier to use for everybody, (NVMe is supposed to be universal after all, it's a standardized protocol), but right now I'm not sure that I can work on it very much in the short term, although I wish to.

@jsl  I'm curious now, you say you have the Plextor M8Pe working under 10.11? Can you confirm this?

Please refer to Post#963 here

Also please test the attached file which worked at 10.11.6 (15G31 & 15G1418)

HackrNVMeFamily-10_11_6.kext.zip

Share this post


Link to post
Share on other sites

Awesome awesome.
I can't test for the upcoming week but here's the bit that stands out. I might have overlooked the rest of the function.
Block size -> 0x10 to 0x01 seems to make sense, but then I'm not sure what the other offsets in the structure mean.


 

-0000000000009188    testb    $0x10, %cl
+0000000000009188    testb    $0x1, %cl
 000000000000918b    jne    0x91f8
 000000000000918d    andb    $0xf, %cl
 0000000000009190    movzbl    %cl, %ecx
 0000000000009193    movzbl    0x82(%rax,%rcx,4), %ecx
-000000000000919b    cmpl    $0xc, %ecx
+000000000000919b    cmpl    $0x9, %ecx
 000000000000919e    jne    0x91f8
-00000000000091a0    movl    $0x1000, 0xa4(%r14)
+00000000000091a0    movl    $0x200, 0xa4(%r14)

Share this post


Link to post
Share on other sites

 

Awesome awesome.

I can't test for the upcoming week but here's the bit that stands out. I might have overlooked the rest of the function.

Block size -> 0x10 to 0x01 seems to make sense, but then I'm not sure what the other offsets in the structure mean.

 

 

 

-0000000000009188    testb    $0x10, %cl
+0000000000009188    testb    $0x1, %cl
 000000000000918b    jne    0x91f8
 000000000000918d    andb    $0xf, %cl
 0000000000009190    movzbl    %cl, %ecx
 0000000000009193    movzbl    0x82(%rax,%rcx,4), %ecx
-000000000000919b    cmpl    $0xc, %ecx
+000000000000919b    cmpl    $0x9, %ecx
 000000000000919e    jne    0x91f8
-00000000000091a0    movl    $0x1000, 0xa4(%r14)
+00000000000091a0    movl    $0x200, 0xa4(%r14)

Can you figure out how to patch for Adata SX8000NP with SM2260 controller after your trial and research of these codes ?

Share this post


Link to post
Share on other sites

Can you figure out how to patch for Adata SX8000NP with SM2260 controller after your trial and research of these codes ?

Well, I think some folks have tried to get it working, it's a matter of finding the right parameters etc.

If someone wants to send an unit I'll get it working

Share this post


Link to post
Share on other sites

What is the right thing to do if i have a plextor nvme ssd which requires the aditional patch which syscl wrote some time ago?

 

Should i edit the 10.12.x.plist and add the patch then generate a nvmehackrfamily.kext based on the modified .plist, or ? 

 

Thanks.

Share this post


Link to post
Share on other sites

What is the right thing to do if i have a plextor nvme ssd which requires the aditional patch which syscl wrote some time ago?

 

Should i edit the 10.12.x.plist and add the patch then generate a nvmehackrfamily.kext based on the modified .plist, or ? 

 

Thanks.

I would use HackrNVMeFamily for the bulk of the patches, then KextsToPatch for the single additional patch specific to Plextor. Don't forget to change Name from IONVMeFamily to HackrNVMeFamily.

Share this post


Link to post
Share on other sites

Hello, i have the Xiaomi Air 13", there's a thread about it here but nvme support's not included. Somebody gave directions to have it detected, see here : http://www.insanelymac.com/forum/topic/319656-xiaomi-mi-notebook-air-13/?p=2347073

 

However, it does not work, he explain that later on, see here http://www.insanelymac.com/forum/topic/319656-xiaomi-mi-notebook-air-13/?p=2351888I patched the config.plist using the code i was given under <key>ACPI</key> as shown below : 

 

<dict>
<key>Comment</key>
<string>change _DSM to XDSM</string>
<key>Find</key>
<data>X0RTTQ==</data>
<key>Replace</key>
<data>WERTTQ==</data>
</dict>

However, the nvme drive still does not appear in disk utility. Its Windows partition does not appear either in the clover bootloader, shouldn't it already show here if it was recognized? What should i do now? I'm a real noob with this and tried all i could so far. Help me please  :)

Share this post


Link to post
Share on other sites

Hi!

 

Not sure if this is the right spot - but looking for some guidance.

 

I have:

 

Mac Pro 5,1 running OSX10.11.6 latest updates/security patches (2016-003 supplemental update)

 

my PCIe controller is an Anfeltec Squid gen2 card with 2 x 128GB intel 600p M.2 NVMe blades

 

I've had no success in getting the Blades to show up in Disk Utility other than the macvidcard driver which is nowhere near the performance i should be getting.  

 

So I uninstalled that kext and have attempted to get the Rehabman patch to work with no success.

 

 

 Below are my steps:

 

 

1) Disabled SIP via System Recovery Terminal  (terminal reports this is successful)

 

2) Created HackrNVMeFamily-10_11_6_supp2016-003 using the github script

 

  • Error reported "Creating patched HackrNVMeFamily-10_11_6_supp2016-003.kext

    Vanilla MD5 matches expected MD5 entry (0aed9374ab41e40976bd191cba126423)

    Patched MD5 matches expected MD5 entry (477dadd3231cbe4327813fa1832871fc)"

 

3) installed into the system using Kext Utility.

 

4) sudo kextload /System/Library/Extensions/HackrNVMeFamily-10_11_6_supp2016-003.kext

 

5)  Restart.....  nuttin,

 

 

I'm assuming it has to with the errors reported in step 2 but have no idea what that means.

 

Any guidance would be greatly appreciated!

 

Cheers,

 

Neil

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
  • Original MacPro or SystemDef for Hack?

 

  • If Hack: Bios has NVMe-support already?
  • Did you move/delete the IONVMe.kext in /S/L/E or did you patch DSDT so IONVMe.kext won't load?
  • Did you
sudo chmod -R 755 Hackrxxxx.kext
sudo chown -R 0:0 Hackrxxxx.kext
sudo cp -R Hackrxxxx.kext /System/Library/Extensions
  • If so, try
sudo rm /System/Library/PrelinkedKernels/prelinkedkernel
sudo touch /System/Library/Extensions
sudo kextcache -u /
  • and reboot.

Share this post


Link to post
Share on other sites

Dear RehabMan,

 

im using IONVMeFamily.kext  and code add to KextstoPatch as #8. but sometimes, my hackintosh dead, it said the osx partition is not verified completely.

 

yesterday, i tried to use nvme_patch on your github but got panic. could you help to check my steps below is true or faile

 

1. reinstall mac os 10.12.3 using IONVMeFamily.kext and add code to KextstoPatch

2. after installing successfully, I download, run and make HackrNVMeFamily-10_12_3.kext

3. remote IONVMeFamily.kext in SLE, remove any <dict>...<\dict> related with IONVMeFamily.kext

4. using kext ward to install HackrNVMeFamily-10_12_3.kext

5. reboot and get panic. tried to boot using -v but the text show on sreen is hard to read. 

 

im using OCZ SSD nvme

thanks.

Share this post


Link to post
Share on other sites

Dear RehabMan,

 

im using IONVMeFamily.kext  and code add to KextstoPatch as #8. but sometimes, my hackintosh dead, it said the osx partition is not verified completely.

 

yesterday, i tried to use nvme_patch on your github but got panic. could you help to check my steps below is true or faile

 

1. reinstall mac os 10.12.3 using IONVMeFamily.kext and add code to KextstoPatch

2. after installing successfully, I download, run and make HackrNVMeFamily-10_12_3.kext[/size]

3. remote [/size]IONVMeFamily.kext in SLE, remove any <dict>...<\dict> related with IONVMeFamily.kext

4. using kext ward to install HackrNVMeFamily-10_12_3.kext[/size]

5. reboot and get panic. tried to boot using -v but the text show on sreen is hard to read. [/size]

 

im using OCZ SSD nvme

thanks.[/size]

Try switching your drive to 4096 AdvancedFormat and you will be able to use it without any patch needed. It is seen natively in 10.12.3 installer. All you need is the OCZ ssd utility bootable iso image.

Share this post


Link to post
Share on other sites

Dear RehabMan,

 

im using IONVMeFamily.kext  and code add to KextstoPatch as #8. but sometimes, my hackintosh dead, it said the osx partition is not verified completely.

 

yesterday, i tried to use nvme_patch on your github but got panic. could you help to check my steps below is true or faile

 

1. reinstall mac os 10.12.3 using IONVMeFamily.kext and add code to KextstoPatch

2. after installing successfully, I download, run and make HackrNVMeFamily-10_12_3.kext[/size]

3. remote [/size]IONVMeFamily.kext in SLE, remove any <dict>...<\dict> related with IONVMeFamily.kext

4. using kext ward to install HackrNVMeFamily-10_12_3.kext[/size]

5. reboot and get panic. tried to boot using -v but the text show on sreen is hard to read. [/size]

 

im using OCZ SSD nvme

thanks.[/size]

You need to read carefully.

According to what you wrote above, you're not using the class-code spoof.

Without the class-code spoof, you must remove /S/L/E/IONVMeFamily.kext.

 

It is very clear in the patch-nvme github README and related links.

Share this post


Link to post
Share on other sites

You need to read carefully.

According to what you wrote above, you're not using the class-code spoof.

Without the class-code spoof, you must remove /S/L/E/IONVMeFamily.kext.

 

It is very clear in the patch-nvme github README and related links.

Dear RehabMan,

 

Thanks so much for your reply.

 

I read your Readme many times but you know i'm quite newbie and it is hard to understand clearly.

 

in Readme you said:

 

 

Once you install, you can create the HackrNVMeFamily and use it (or use one you already created), but you must remove IONVMeFamily.kext from /System/Library/Extensions

and in the end you said:

 

 

 

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

 

so they make me confused.

 

now it works for me.

 

i used ./patch_nvme.sh 10_12_3 and only remove IONVMeFamily.kext  in S/L/E and in EFI clover. dont remove any KextsToPatch related IONVMeFamily.kext as i used for OS installtion.

 

now i read Readme again to know what is nvme DSDT you said. it is quite hard to understand.

 

Thanks so much. 

Share this post


Link to post
Share on other sites

Dear RehabMan,

 

Thanks so much for your reply.

 

I read your Readme many times but you know i'm quite newbie and it is hard to understand clearly.

 

in Readme you said:

and in the end you said:

 

 

so they make me confused.

 

now it works for me.

 

i used ./patch_nvme.sh 10_12_3 and only remove [/size]

 

IONVMeFamily.kext  in S/L/E and in EFI clover. dont remove any KextsToPatch related [/size]IONVMeFamily.kext as i used for OS installtion.[/size]

 

now i read Readme again to know what is nvme DSDT you said. it is quite hard to understand.[/size]

 

Thanks so much. [/size]

You found the part you missed. As I stated earlier in this thread (in reply to your first query), you must remove IONVMeFamily.kext unless you use the class-code spoof. I don't know how to make it any more clear in the README.

Share this post


Link to post
Share on other sites

A small addition to my previous post concerning the 4k sector size. Today I got a new SSD, an NVMe SK Hynix PC300 and this one is also compatinble with 4096 sector size like Toshiba's XG3. As far as I know it is part of NVMe specification so we aren't breaking anything if it is reported as supported. To check if your ssd supports the 4k sector size you have to issue

# smartctl -a /dev/nvme0

command under any linux distro (meant you have the smartmontools package istalled).
If in the output table entitled "Supported LBA Sizes (NSID 0x1)" you have more than one line, than your eligible to 4k sector switching.
For example, here is an example of Toshiba XG3/ OCZ RD400 NVMe output:

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf 
0 +     512       0         2 
1 -    4096       0         1

Here are two options for the sector size, and the "+" symbol means the currently used LBA-format, e.g. 512. This option will require NVMeFamily patching throug every future release or significant DSDT modification needed for use with patched kexts.

The 4096 aka 4k aka AdvancedFormat sector size is supported natively by Windows 8+, macOS and linux. So we get futureproof and hasslefree solution which uses native OS drivers to operate with the storage.

The "Rel_Perf" according to this explanation represents the relative performance of the drive. Lower is the value better is the overall performance. However they are some SSDs like my SK hynix PC300 where there is no difference in values. 0 is the reference value.

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf 
0 -     512       0         0 
1 +    4096       0         0

Since we have two options listed in the smartctl output we are able to switch between them as many times as needed. To do this you need to issue

# nvme format -l X /dev/nvme0

command under any linux distro (meant you have the nvme-cli package istalled) where "X" represents your choice from smartctl output indicated in the "Id" column. E.g. to switch to 4k sector for toshiba in that example you have to issue

# nvme format -l 1 /dev/nvme0

which is exactly the operation performed by the original Toshiba OCZ SSD Utility. Checking the smartctl output after issuing this command will give you an output like this one:

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf 
0 -     512       0         2 
1 +    4096       0         1

If you get similar output, it means you have done everything right.

Be warned that "nvme format" gonna erase your ssd and all data would be lost. So be carefull and mind making a backup of important data, especially the clover folder.

In Clover starting from build 4000+, maybe earlier there is an option to disable KextsToPatch selectively by ticking up the necessairy patches. After LBA conversion simply uncheck the NVMEe patchset from Pike R. Alpha and your set. The SSD should appear in DiskUtility ready to proceed with partitionning and macOS install.

As for today this method was successfully tested with Toshiba XG3 and SK hynix PC300 NVMe drives under Dell 9350. But I'm pretty sure it is gonna work with any NVMe SSD supporting the 4k sector size. Good luck! :wink_anim:


Thanks everybody for your reports!

List of suitable NVMe SSDs for that conversion:

  • Toshiba XG3
  • Toshiba XG4
  • Toshiba XG5
  • Toshiba XG5-P
  • OCZ RD400
  • Intel SSD750
  • WD Black PCIe SSD
  • WD Black NVMe SSD
  • SanDisk Extreme PRO M 2 NVMe 3D
  • SK Hynix PC300
  • SK Hynix PC401
  • Kingston KC1000
  • Plextor M9Pe

As always everything you do is at your own risk, so be prepaired to warranty replacements of your driive. Once agian: you may brick your drive.
Double-check that your drive have all the needed firmware updates (especially in the case of XG3 & PC300), sometimes it's available on the Dell's website as they're using them as OEM.

Edited by nos1609
Updated SSD list

Share this post


Link to post
Share on other sites

A small addition to my previous post concerning the 4k sector size.

 

...

Just FYI: Samsung 950 Pro is not 4k capable.

Share this post


Link to post
Share on other sites

Just FYI: Samsung 950 Pro is not 4k capable.

Sure, it is stated even there https://www.smartmontools.org/wiki/NVMe_Support

So does Samsung PM951. However NVMe got more widespread last year and now Samsung is one of 10+ manufacturers, including Intel, Toshiba, Plextor, Hynix, WD etc... That is why I mention that we have to find it out if the support is present in ssd's cobtroller or not.

Share this post


Link to post
Share on other sites

Yeah... noticed that. But I also checked with my actual device.

 

I should probably check for updated firmware. Even though it is unlikely, it still might be something Samsung would update along the way.

Edit: same with updated firmware

 

However NVMe got more widespread last year and now Samsung is one of 10+ manufacturers, including Intel, Toshiba, Plextor, Hynix, WD etc... That is why I mention that we have to find it out if the support is present in ssd's cobtroller or not.

Yes. Competition is good.

Share this post


Link to post
Share on other sites

Dear RehabMan,

 

im going to create class-code spoof as your guide. but my ssd does not have bios name or location path like some examples you show.

 

im using windows 7 and SSD ocz RD400.

 

vj6d6wZJkAkCGzAuvs-O_WBNPr_SM5a7Pyurl4U2zto

I used Windows 10. No idea if Windows 7 has the same features for determining ACPI/PCI path.

Share this post


Link to post
Share on other sites

I used Windows 10. No idea if Windows 7 has the same features for determining ACPI/PCI path.

because i cound not identity Biosname or Location Path so i will stay using the method that install Hackrnvme and remove IOnvmefamily.

 

in future, when i see mac os update, can i do as below?

 

1. delete Hackrnvme

2. install IOnvmefamily.

3. restart and update

4. delete IOnvmefamily

5. make hackrnvme again with correct mac version and install

 

do you think it is ok ?

Share this post


Link to post
Share on other sites

Just FYI: Samsung 950 Pro is not 4k capable.

Racer, so if I understand correctly, our samsung has no size of 4K, while if there are SSD NVME with dimensions of 4 K, we no longer need kext hack?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×