Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Rockadile

macrumors 6502a
Original poster
Jun 11, 2012
501
210
I have installed a 850 Evo and upgraded to Yosemite than realized TRIM can't be enabled without disabling kext.

I'm reading conflicting posts on whether it's necessary.
Apparently sandforce controllers has a form of it's own TRIM? Not sure about Samsung MGX.
 

olletsocmit

macrumors 6502
Jun 24, 2010
296
2
USA
I am not sure what kext signing is. Can u explain what it is to me. Does the app I am using disable it?
 

SaSaSushi

macrumors 601
Aug 8, 2007
4,156
554
Takamatsu, Japan
Garage collection is not the same as TRIM. I highly recommend enabling TRIM (and disabling KEXT signing) for the best performance over time.

I have been booting from a 500GB Samsung 840 EVO in a Delock 42490 TB enclosure for a year and a half now starting and have had zero issues.

I am currently using Yosemite. See here for another useful article on the issue.
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
I've read this: https://www.cindori.org/trim-enabler-and-yosemite/

I don't really feel like disabling kext signing.

That is up to you. Worst thing that could happen at this point, to my knowledge, is that your system reenables kext signing and prevents you from booting as long as the Trim Enabler hack is in place. In that case the website you linked has a solution and if that doesn’t work you can still reinstall OS X from recovery without losing your files. You just have to remember to disable it whenever you update your system and when you reset the NVRAM manually.
 

crjackson2134

macrumors 601
Mar 6, 2013
4,847
1,957
Charlotte, NC
Actually, I've been using TrimEnabler for a very long time and it works well. I've done many OS updates, PRAM resets etc... It's never given the failed boot issue. The only perceived problem was that I once tried to disable it prior to an OS update (as recommend) but I couldn't disable it. It threw a messege stating the it couldn't be disabled because there was no longer a backup file. I ignored it, installed the update and rebooted without a problem.

Since then, I've updated my SSD to an Apple PCIe blade, so Trim isn't an issue for the boot drive anymore.
 

tiamo

macrumors newbie
Jul 8, 2010
9
8
a little about trim

if you can access your ssd's firmware, you can modify the IDENTIFY DEVICE DATA to return a model number starting with "APPLE SSD", then trim will be enabled by default.
 

Attachments

  • キャプチャ.PNG
    キャプチャ.PNG
    14.6 KB · Views: 509
  • スクリーンショット 2015-05-24 23.57.46.png
    スクリーンショット 2015-05-24 23.57.46.png
    144.7 KB · Views: 463
  • スクリーンショット 2015-05-24 23.57.51.png
    スクリーンショット 2015-05-24 23.57.51.png
    144.4 KB · Views: 501

That-Guy

macrumors 6502a
Feb 25, 2012
662
57
UK
if you can access your ssd's firmware, you can modify the IDENTIFY DEVICE DATA to return a model number starting with "APPLE SSD", then trim will be enabled by default.

Is this possible with Samsung 840/850 SSDs?

This would be so much easier in the long run.
 

mikeboss

macrumors 68000
Aug 13, 2009
1,546
862
switzerland
if you can access your ssd's firmware, you can modify the IDENTIFY DEVICE DATA to return a model number starting with "APPLE SSD", then trim will be enabled by default.

holy cow, tiamo strikes again :cool:

I had once a look at the firmware/updater of the Plextor but couldn't find where or how I can edit the DEVICE IDENTIFIER STRING... same with the SAMSUNG. so, tiamo, could you please share a little bit more about how this can be done?

EDIT:
hm. looking at the windows screenshot you were using arcconf.exe? is it possible to use this utility without an ADAPTEC HBA? the command would be "arcconf IMAGEUPDATE"? how to get ahold of the SSD's firmware?

thnx!
 
Last edited:

Pieterr

macrumors regular
Mar 22, 2015
135
0
The Netherlands
I had once a look at the firmware/updater of the Plextor but couldn't find where or how I can edit the DEVICE IDENTIFIER STRING... same with the SAMSUNG. so, tiamo, could you please share a little bit more about how this can be done?

This is exactly what TrimEnabler does for you... :cool:
 

mikeboss

macrumors 68000
Aug 13, 2009
1,546
862
switzerland
This is exactly what TrimEnabler does for you... :cool:

wrong! this is absolutely not the case! trim enabler manipulates /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage so it will support TRIM on ANY brand/model SSD. manipulating the SSD's firmware is a quite different approach. no need to fiddle with boot args or editing OS X's KEXTs.
 
Last edited:

donlab

macrumors 6502
Jun 3, 2004
305
94
USA
I have installed a 850 Evo and upgraded to Yosemite than realized TRIM can't be enabled without disabling kext.

I'm reading conflicting posts on whether it's necessary.
Apparently sandforce controllers has a form of it's own TRIM? Not sure about Samsung MGX.

Some people insist that TRIM is necessary while others don't. For me, I prefer not to disable a security feature. (In b4 the naysayers "where was this security feature in mavericks") My Evo 840 is already blazing fast without trim that I don't think I will discern the difference. What I did was shrink my OS partition size by 9% of the total capacity. This space will be available to SSD for its internal garbage collection. Your partition will appear completely full to the SSD since there is no trim, but SSD still has space to rearrange data on its own.
 

PeterHolbrook

macrumors 68000
Sep 23, 2009
1,625
441
if you can access your ssd's firmware, you can modify the IDENTIFY DEVICE DATA to return a model number starting with "APPLE SSD", then trim will be enabled by default.

Can Samsung Magician 4.6 modify that data? Supposedly, it will only read Samsung SSD's, but can it write modified firmware updates to Samsung SSD's that identify themselves as APPLESSD? If the regular Samsung Magician 4.6 can't do this, can it be successfully modified so that the updated firmware will identify itself as APPLESDD?

If Samsung Magician won't do the job, can you suggest any other DOS/Windows/Linux/OS X piece of software that will both backup the original firmware of an SSD and then write a Hex-edited version (identifying itself as APPLESSD) back to the drive?
 

b0fh666

macrumors 6502a
Oct 12, 2012
957
786
south
kext signing is probably the first step in the world domination plans of evil appel corp, soon OSX will be the same [censored] as IOS, no downgrades, no dirty code running, only sanitized and appel-corporate approved code, etc.

I think it was optional in mav, default in yosumfinky, nonexistent before, and probably mandatory on the next release or the one after.

disable that thing without remorse man. TRIM is important.

cheers
 

tiamo

macrumors newbie
Jul 8, 2010
9
8
holy cow, tiamo strikes again :cool:

I had once a look at the firmware/updater of the Plextor but couldn't find where or how I can edit the DEVICE IDENTIFIER STRING... same with the SAMSUNG. so, tiamo, could you please share a little bit more about how this can be done?

EDIT:
hm. looking at the windows screenshot you were using arcconf.exe? is it possible to use this utility without an ADAPTEC HBA? the command would be "arcconf IMAGEUPDATE"? how to get ahold of the SSD's firmware?

thnx!

the arcconf is a helper program written by myself to flash the ssd attached to my adaptec raid card, it is not the official command line tools made by adaptec.

the firmware in plextor ssd has a simple structure.
the firmware is divided into two regions, boot code and user code,and user code is also divided into more small parts called as BIN.
boot code, user code, BIN contain a header followed by payload data and one byte payload checksum.

the header's length is 0x20
the first uint32 should be a fixed value 0x5a
the second uint32 is the total length
the third uint32 is the payload data length
after payload data, there is a one byte checksum, so the total length=payload_lenth+1
the last byte of header is the header's checksum
checksum is computed by summing the whole payload data byte by byte.

there is also a total code length uint32(both boot and user code) and an uint16 user code checksum at the end of the firmware. the checksum counts only user code(boot code is not included)

if you have a decrypted firmware file(yes, plextor encrypted the firmware in his firmware updater tools), you can see something like this

offset 0x0000-0x2000 is boot code
offset 0x2000-0xxxxxx is user code
AND offset 0x2060-0x2088 is the raw ATA model string returned by IDENTFY DEVICE command. we need modify this! but wait, remember the CHECKSUM.
offset 0x3fff8-ox3fffc is the total length of both boot and user code, and 0x3fffe is the user code's checksum.(total length of the firmware is 256kb)

--------- my m5p dump-------(for example)
first is the boot code
Code:
00000000 5A 00 00 00 0D 1C 00 00 0C 1C 00 00 20 00 00 00 Z........... ...
00000010 00 E0 01 00 00 E0 01 00 00 00 00 00 00 00 00 8D ................

then the user code
Code:
00002000 5A 00 00 00 49 01 00 00 48 01 00 00 20 20 00 00 Z...I...H...  ..
00002010 00 00 00 04 00 00 00 04 00 00 00 00 00 00 00 35 ...............5
00002020 73 73 64 62 69 6E 76 32 4C 49 54 45 4F 4E 20 4C ssdbinv2LITEON L
00002030 43 53 31 32 38 4D 36 53 00 00 00 00 00 00 00 00 CS128M6S........
00002040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00002050 44 43 37 30 32 30 47 20 01 02 00 00 00 00 00 00 DC7020G ........
00002060 50 41 4C 50 20 45 53 53 20 44 50 28 45 4C 54 58 PALP ESS DP(ELTX
00002070 52 4F 50 20 2D 58 32 31 4D 38 50 35 6F 72 20 29 ROP -X21M8P5or )
00002080 20 20 20 20 20 20 20 20 2E 31 38 30 20 20 20 20         .180
looking at 0x2008, the length is 0x148(LE32), this is the first BIN in user code region

Code:
00002160 10 10 12 10 13 10 22 10 CA 5A 00 00 00 79 EC 01 ......"..Z...y..
00002170 00 78 EC 01 00 89 21 00 00 00 00 00 40 00 00 00 .x....!.....@...
00002180 40 00 00 00 00 00 00 00 4F                      @.......O
from 0x2020 to 0x2167(length 0x148) is the payload data, and 0x2168 is checksum(sum of those bytes in [0x2020, 0x2167], 0x148 bytes), yes, we need modify this byte too. and there is another BIN starting from 0x2169, length is 0x1ec78

Code:
0003FFF0 FF FF FF FF FF FF FF FF 07 C4 03 00 FF FF 8E FE ................
total user and boot code length is 0x03c407, and use code's checksum is 0xfe8e. we also need to modify the last uint16, sum of those bytes in [0x2000, 0x3c407)

summary, first we should modify model string at 0x2060, then regenerate a new BIN checksum and a new user code checksum

of course, first we need to decrypt the firmware file from the official updater released by plextor, modify the model string, regenerate the checksum, then encrypt the modified firmware file, and finally use the official flasher to upload it to ssd.

BUT BUT, actually the encryption algorithm used by plextor is a simple xor, but the key buffer generation is a boring process, i did not go deep in it.

we can use another simple approach by using a debugger.
put a breakpoint on official updater's decrypt routine, let it to decrypt the firmware first, after our breakpoint hits, dump the decrypted firmware from memory, we got the plaintext one, modify it, then flash by ourselves.

then, how to flash the decrypted firmware to ssd?
it is simple, just one ata command DOWNLOAD MICROCODE 92h.
first divide the firmware into 2kb block, then send those blocks to ssd by using feature 3(download with offset), finally send a zero length 92h with feature 7 and LBA-mid=0x4c, LBA-hi=0x41.(0x414c means update both boot and user code)

Code:
128 times
feature  sector lba-low  lba-mid      lba-hi          device     command
3        4      0        offset0-7    offser8-15      0xa0       0x92

finally
7        0      0        0x4c         0x41            0xa0       0x92
please check ata command set spec for more info about DOWNLOAD MICROCODE.

and, one more thing
looking at firmware's offset 0x2050, there is a string like DC7020G, this is the ext firmware info, first 6 bytes is the hardware revision? m5p has two different values(DC7020 and BC7020) and the official firmware updater has two firmware files, one for DC, one for BC, you should flash the one matching with your ssd.
your ssd's current value is returned as additional production identifier in IDENTIFY DATA word170.
and you can use a vsc to retrieve it
Code:
output a sector buffer(0x200) to device first
uint8_t sectorBuffer[512]={0x0a, 0x07}

task file
feature sector lba-low lba-mid lba-hi  device command
0xfc    1      0       0       0       0xa0   0xff

then read a sector from device
task file
feature sector lba-low lba-mid lba-hi  device command
0xfd    1      0       0       0       0xa0   0xff
ext firmware info is the first 8 bytes of the output data
 

Cindori

macrumors 68040
Jan 17, 2008
3,528
378
Sweden
It's definitely possible to edit your SSD firmware to pose as an Apple SSD and get Trim that way. Ever since the Angelbird SSD was released I've gotten quite a bit of requests to try and use this method in Trim Enabler in order to avoid the Yosemite issues.

Here's my take on why I never pursued this method:

1. You have to reverse engineer every firmware manually. Just as tiamo outlines above - it is very technically challenging. I'm sure it took him quite some time to do this. And the end result is just one firmware. A completely new method may have to be devised for another manufacturer - and it may not be possible at all for some.

2. Flashing can not be done from OS X. It may be if you connect through PCIe and write a completely new driver from scratch, but not from SATA (you can't send ATA commands through OS X driver).

3. Flashing is a risky process. Screw something up and you brick the drive - and all it's contents.

4. Modifying the firmware is likely to void your warranty and break support for manufacturers utilities such as firmware updaters.

Even just one of these factors is enough for this method to not be a viable option for 99.9999% of users. And the last 0.0001% are likely to be technically knowledgeable enough to swiftly recover from the Yosemite bootscreen issue anyway.

So in my opinion, it's not a viable solution to enable Trim. Still very interesting to see someone realise it.
 
Last edited:

That-Guy

macrumors 6502a
Feb 25, 2012
662
57
UK
It's definitely possible to edit your SSD firmware to pose as an Apple SSD and get Trim that way. Ever since the Angelbird SSD was released I've gotten quite a bit of requests to try and use this method in Trim Enabler in order to avoid the Yosemite issues.

Here's my take on why I never pursued this method:

1. You have to reverse engineer every firmware manually. Just as tiamo outlines above - it is very technically challenging. I'm sure it took him quite some time to do this. And the end result is just one firmware. A completely new method may have to be devised for another manufacturer - and it may not be possible at all for some.

2. Flashing can not be done from OS X. It may be if you connect through PCIe and write a completely new driver from scratch, but not from SATA (you can't send ATA commands through OS X driver).

3. Flashing is a risky process. Screw something up and you brick the drive - and all it's contents.

4. Modifying the firmware is likely to void your warranty and break support for manufacturers utilities such as firmware updaters.

Even just one of these factors is enough for this method to not be a viable option for 99.9999% of users. And the last 0.0001% are likely to be technically knowledgeable enough to swiftly recover from the Yosemite bootscreen issue anyway.

So in my opinion, it's not a viable solution to enable Trim. Still very interesting to see someone realise it.

Some very good points, for me personally I would still flash it :D

Especially now the 840 Evo Firmware has fixed the initial issues the drive had.

I suppose it depends on the person :)
 

crjackson2134

macrumors 601
Mar 6, 2013
4,847
1,957
Charlotte, NC
The hoops we will jump through to avoid Apple's lock out techniques.

I purchased a PCIe Adapter and an Apple/Samsung Blade SSD to tackle the problem. If I had an easy way to have the firmware of my 840 Pro modified I do that too.

I'll probably end up moving the 840 Pro to my Linux laptop, and buying a couple of 1TB Anglrbird SSD's for my cMP (in addition to the blade SSD).

The easiest and cheapest solution is still TrimEnabler which has worked perfectly for me (and still does when booting from the 840 Pro).
 

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
Some very good points, for me personally I would still flash it :D

Especially now the 840 Evo Firmware has fixed the initial issues the drive had.

I suppose it depends on the person :)

I would like to flash it as well. Of course I don't want to break it, but I don't mind to test it. However, it's too hard for me find out how to change the ident in the 840 Evo firmware :D
 

simonsi

Contributor
Jan 3, 2014
4,851
735
Auckland
10.9 and before didn't even have this feature.

Ah but if we limited progress to only what we had before, we wouldn't progress.

I've been running 2 SSDs since Yosemite came out without Trim and no noticeable or measurable speed dropoff on either so far...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.