NOTE: This is tested on the versions mentioned in the title, and NOT earlier or later versions. YMMV.
Run the following commands in Terminal…
Backup the original driver:
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
Modify the driver (choose only one of the following lines, based on the version):
# 10.9.4 & 10.9.5
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
# 10.8.3 to 10.9.3
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\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
# 10.7.5, 10.8.1, 10.8.2
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x4D)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
Run these commands in succession to clear the system caches to enable OS X to pick up the modified driver:
sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches
sudo touch /System/Library/Extensions/
Restart the Mac.
First thanks for the patch for 10.8.2.
I did a backup first then follow yours.
Based on another web site, I add another step after your patch which I am not sure it is important:
Also, after the command "sudo kextcache -system-prelinked-kernel"
I got some system messages:
/ locked; waiting for lock.
Lock acquired; proceeding.
Kernel file /mach_kernel does not contain requested arch: i386
But ignore it and continue with the "sudo kextcache -system-caches" and reboot; the Apple did report Trim Support.
Hence, may be everything is ok.