Enable TRIM on SSD drives running Snow Leopard

Although it’s now widely publicised in the hackintosh community, a couple of months ago (March 2011) with the release of the Mac OS X Snow Leopard 10.6.7 update (especially for new MacBook Pro laptops) a couple of people with good knowledge of programming reported that the .kext that controls the AHCI SATA controller was updated with TRIM support, even since 10.6.6, apparently only for Apple-ordered SSD drives that had the identifier “APPLE SSD” (visible from System Profiler > Serial-ATA).

Now, user cindori from http://www.groths.org has made it simple for newbies and experienced users alike: a tool that enables and disables TRIM support for Snow Leopard users (10.6.6 or newer) with SSD drives in their computers (original Apple hardware as well as hackintosh systems).

TRIM Support Enabler

With his TRIM Support Enabler (currently at v1.1) we can install and uninstall (i.e. revert to original) the patched .kext that recognises any SSD with TRIM support (visible in System Profiler) provided that our own SSD indeed supports TRIM (check with your manufacturer’s specifications and perhaps use the latest firmware update for your SSD drive). Older SSD drives that never supported TRIM by default will not ‘magically’ get TRIM, obviously.

The secret lies in the updated IOAHCIFamily.kext of Snow Leopard, in the /System/Library/Extensions/ folder, which contains the plugin IOAHCIBlockStorage.kext: the binary of this plugin (in the /MacOS/ folder) when viewed with a hex editor, contains two hard-coded references of “APPLE SSD” that is the string expected to be returned from polling the drive (thus only native support for latest Apple SSDs).

Initially found on www.hardmac.com, I read that the driver fist checks to see if the drive is of “rotational” or “solid state” type. Then, if it is indeed an SSD drive, it sends yet a second command (the TRIM one) and expects a result. If the SSD natively supports this, it replies back; if it doesn’t support, there is no reply. But Apple’s original .kext works only with their own SSD drives, so this hack bypasses the identifier check and allows all SSDs to be supported. The actual hack is nothing more than a replacement of “APPLE SSD” identifier with zeros!

Hopefully, the new OS X system code-named “Lion” will allow TRIM to be supported on all SSD drives…

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s