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

mayuka

macrumors 6502a
Original poster
Feb 15, 2009
609
66
The current command does not work with the newest update to 10.9.4. Damn... And I forgot to make a copy before applying the command...
 

mayuka

macrumors 6502a
Original poster
Feb 15, 2009
609
66
Trim Enabler works, perl script, etc. don't anymore.

The only reason why Trim Enabler still works is that it just copies a modified IOAHCIBlockStorage file that originally dates back to Snow Leopard (10.6). This way, you introduce some bugs. I'd rather stick without TRIM than to use Trim Enabler. Just my 2 cents. :confused:
 

sumo.do

macrumors regular
Mar 12, 2014
161
39
Australia
The current command does not work with the newest update to 10.9.4. Damn... And I forgot to make a copy before applying the command...

I am using Trim Enabler Version 3.2.2 paid version and it works ok on 10.9.4 on an OCZ Agility 3.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,171
15,691
California
The only reason why Trim Enabler still works is that it just copies a modified IOAHCIBlockStorage file that originally dates back to Snow Leopard (10.6). This way, you introduce some bugs. I'd rather stick without TRIM than to use Trim Enabler. Just my 2 cents. :confused:

This has not been the case since Trim Enabler 1. Starting with version 2 the app just runs the Terminal command for you to modify the existing kext then sets the permissions etc. V2 and up do not replace the kext with the old Snow Leopard version. There was an old post around here somewhere from Cindori explaining this.
 

NoBoMac

Moderator
Staff member
Jul 1, 2014
5,818
4,427
Agree With Weaselboy

Just ran the TRIM Enabler program, and it worked.

Did some digging around yesterday and today. Within the TRIM Enabler executable and app container, did not find any kext lying around. Code is doing something along the lines of the scripts people have of finding the pattern and replacing "APPLE SSD" with nul characters.

Also compared before/after the kext to see what's going on, and reinforces that old extensions are not being loaded.

So, with all that out of the way, here is the hex dump of the relevant section of the new extension for those wanting to go the script route and need to adjust their scripts. Old pattern was "Rotational\0APPLE SSD\0T". Now, note lots of other stuff between "Rotational" and "APPLE SSD".

Before:
HRAwZIk.png


After
Rnq6J1a.png
 
Last edited:

rkbca1

macrumors newbie
Apr 19, 2012
4
0
Just ran the TRIM Enabler program, and it worked.

So, with all that out of the way, here is the hex dump of the relevant section of the new extension for those wanting to go the script route and need to adjust their scripts. Old pattern was "Rotational\0APPLE SSD\0T". Now, note lots of other stuff between "Rotational" and "APPLE SSD".

Thanks NoBoMac

Based on that I confirmed that the following patch does the trick if anyone wants to use perl.

Code:
sudo perl -pi -e 's|\x00APPLE SSD\x00Time To|\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Time To|s' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
 

mayuka

macrumors 6502a
Original poster
Feb 15, 2009
609
66
So, with all that out of the way, here is the hex dump of the relevant section of the new extension for those wanting to go the script route and need to adjust their scripts. Old pattern was "Rotational\0APPLE SSD\0T". Now, note lots of other stuff between "Rotational" and "APPLE SSD".

Code:
sudo perl -pi -e 's|\x00APPLE SSD\x00Time To|\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Time To|s' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

Thanks. I prefer a shell script. Somehow I feel safer with it because I know what it is doing..

Someone pointed me toward this: https://gist.github.com/return1/4058659

Code:
sudo perl -pi -e 's|(^\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

I'll try out in a jiffy.
 

Donka

macrumors 68030
May 3, 2011
2,842
1,439
Scotland
Thanks NoBoMac

Based on that I confirmed that the following patch does the trick if anyone wants to use perl.

Code:
sudo perl -pi -e 's|\x00APPLE SSD\x00Time To|\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Time To|s' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage


Thanks - worked great for me.
 

NoBoMac

Moderator
Staff member
Jul 1, 2014
5,818
4,427
The driver compares only the string, and works without problems, if the string length (a C-String) is zero!?

Seems like it.

Thanks. I prefer a shell script. Somehow I feel safer with it because I know what it is doing..

Someone pointed me toward this: https://gist.github.com/return1/4058659

Code:
sudo perl -pi -e 's|(^\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

Might work, but would not be comfortable using. WAY too general. If I'm reading it right: find a pattern of 1-20 non-nul characters, then 9 non-nul, 1-20 nuls, then a capital T. Going forward, this pattern could potentially match lots of things, ergo, might nul out the wrong thing, ergo, box that might not start.

Rkbca1's solution is much better, imo, since looking for very specific patterns and much less susceptible to wiping out the wrong thing.
 

Cindori

macrumors 68040
Jan 17, 2008
3,527
378
Sweden
The only reason why Trim Enabler still works is that it just copies a modified IOAHCIBlockStorage file that originally dates back to Snow Leopard (10.6). This way, you introduce some bugs. I'd rather stick without TRIM than to use Trim Enabler. Just my 2 cents. :confused:

This is false information.
Trim Enabler 1.0 (released back in 2011) used this as a method. It also had a label stating "Only for use on Snow Leopard".

Ever since Trim Enabler 2.0 (released back in 2012), Trim Enabler unlocks the kernel extension directly, leaving your OS otherwise unaltered.

Trim Enabler has made quite a journey since then. Here are screenshots of version 1, 2 and 3 respectively to put things in perspective.

trimversions.png
 
  • Like
Reactions: Jack Neill

crjackson2134

macrumors 601
Mar 6, 2013
4,826
1,950
Charlotte, NC
Trim Enabler has made quite a journey since then.


great work, and great explanation Cindori. You are a talented coder, and I appreciate your hard and dedicated work.

Would you consider investigating and implementing an option to clear & trim unused portions (free space) of the drive? This would be a really nice touch if possible. Of course this would be a paid option in your pro version.

Thanks again for a great App.
 

BrockJon

macrumors newbie
May 18, 2014
19
0
The above commands weren't working for me on 10.9.4. Running this series (found here https://gist.github.com/clarencesong/3768688), however, did:

sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage-backup

sudo perl -pi -e 's|(^\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

sudo kextcache -system-prelinked-kernel

sudo kextcache -system-caches

sudo touch /System/Library/Extensions/
 

MacBroadcaster

macrumors newbie
Nov 29, 2016
1
0
The above commands weren't working for me on 10.9.4. Running this series (found here https://gist.github.com/clarencesong/3768688), however, did:

sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage-backup

sudo perl -pi -e 's|(^\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

sudo kextcache -system-prelinked-kernel

sudo kextcache -system-caches

sudo touch /System/Library/Extensions/


Worked for me on a Mac Pro 3,1 running 10.9.5 combo update with Samsung 850 EVO 1TB SSD -- Thanks!
 

doynton

macrumors 6502
Oct 19, 2014
299
17
So, with all that out of the way, here is the hex dump of the relevant section of the new extension for those wanting to go the script route and need to adjust their scripts. Old pattern was "Rotational\0APPLE SSD\0T". Now, note lots of other stuff between "Rotational" and "APPLE SSD".

Before:
HRAwZIk.png


After
Rnq6J1a.png
Thanks so much for the pictures. I know this is an old thread but some of us are still happily using these old systems - mbp2.2 in my case.

I couldn't understand what these scripts were doing so I based on your pictures :
  • Downloaded the 0xED hex editor (free)
  • sudo Downloads/0xED.app/Contents/MacOS/0xED
  • search 'APPLE SSD' and replace both instance with x00 (take edit > write mode option to overwrite) and save.
  • sudo kextcache -system-prelinked-kernel
  • sudo kextcache -system-caches
  • sudo touch /System/Library/Extensions/
  • reboot
It took perhaps 5 minutes and worked perfectly.

I had previously tried downloading Trim Enabler 4 but unfortunately it doesn't work as I'm running 10.7.5. It says "Requires macOS 10.9 or later. Versions for older macOS included " but this seems not to be the case. I couldn't find the old free version 2 anywhere I trusted so you saved me EUR 16.79 with those pictures - thanks.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.