How to install an AHCI SATA driver in Windows XP, Vista and Win7

Discussion in 'Mac Pro' started by gugucom, Aug 6, 2009.

  1. macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
    #1
    1. What this is about

    This is about the installation of AHCI drivers to SATA ports for Windows. AHCI drivers (Advanced Host Controller Interface klick -> http://de.wikipedia.org/wiki/Advanced_Host_Controller_Interface for Wiki) are advanced performance drivers for the SATA controller in your Mac Pro (ICH10R chips for Nehalem - ESB2 for all others). When you go to profiler in OS X and bring up ATA you will see that your disks will all be connected by AHCI protocols.

    Windows natively uses legacy drivers instead of AHCI when you install it. It expects a BIOS command to select the AHCI mode. On a BIOS machine you simply use a software switch to select the configuration. On an EFI machine as the Mac, you have to manipulate the boot mechanism because the firmware has no user adjustable features. You actually edit your Master Boot Record (MBR) inside the GUID or MBR partition table with a terminal script. I will come to that later.

    If you are making a fresh installation of Windows from the install disk you can pre load the AHCI drivers from the floppy facility (check the download link in section 3). In Vista and Win7 you do this from the installation window where you can format or partition drives. In XP you have to hit the F6 key in the beginning when XP starts to load from the optical disk.

    This tutorial is based on the instructions from Ludachris at http://www.insanelymac.com/forum/index.php?showtopic=126089&hl= Many thanks to him.

    The shell script for the MBR patch is made by Johnsock. http://www.insanelymac.com/forum/index.php?act=attach&type=post&id=49096 Also a big thank you to him.


    2. Some potential traps to avoid

    Some people like to use a unused ODD-SATA port for a Windows HDD or SSD. This is possible as soon as the AHCI driver is working. In order to make the AHCI installation you need to fit the Windows drive to a standard HDD port and make the installation according to section 5.

    There is a bummer which may hit you if you already use a SW RAID in OS X with a pre 2009 machine. An OS X software RAID array prevents Windows from recognizing other SATA drives as internal. The installation program will tell you that you are installing to an external drive although you are setting your Windows drive properly up on one of the # 1-4 HDD bay.

    To work around this problem you can physically remove the RAID disks and put them away for a moment . After installing Windows you can put the array back in and it will run without a problem again, so you need not be concerned to remove the array temporarily.

    To substitute for your now missing array clone OS X to a single disk before you remove your array and when you have it taken out, fit that disk. Then you do your Windows installation stuff. When you are finished with Windows you remove the single disk and refit your array.

    The 64-bit varieties of Vista and Win7 have 32-bit emulations installed which will allow you to run any 32-bit program. So they are much better to use. A word of warning to 2006 and 2007 Mac Pro owners. Your machines use a 32-bit EFI. It will not be able to read Windows install DVDs with multiple images like the anytime upgrade DVDs. The 32-bit EFI boot loader freezes when you try to load an install disk with multiple images. Known workaround at this time use Jowie's tweak or a similar method to make the file variables palatable to the EFI32 boot loader. http://forums.macrumors.com/showpost.php?p=8513769&postcount=21


    3. Preparations

    Download the Intel Matrix Storage Manager http://www.intel.com/support/chipsets/imsm/index.htm from this adress. If you run XP you also need the floppy disk facility that you find there. The executable we will need very much later when we are practically done changing the MP to AHCI but get hold of it for now.

    Intel have reported that there was a Vista installation issue with their chips driver (Intel Matrixs storage) up to version 7.0. It is therefore recommended to use 8.8 now. Win7 is officially only supported by 8.9.

    When you have made those downloads put the folder with the floppy facility on a USB stick or burn it on CD. If you are hell bent to use XP you will actually need floppies because XP will not let you use other means. Generally XP isn't desirable on a Mac Pro because it is only supported in 32-Bit and not in 64-Bit which will make most of your RAM (above 2 GB) memory useless.

    Copy the zipped file with Johnsock's shell script which is attached to this posting to your OS X drive. You have to unzip it for use.

    Next go to disk utility in OS X and make a list of the identifiers of your installed drives. You can right click the drive name or use the info button which tells you the internal name of each drive. If the drive is shown as disk2 note it with the extended code form that the shell script uses ( /dev/disk2 ). Make a paper record of that full name of the disk and make sure you copy exactly that code. You will need this later when you may have no access to disk utility and are doing some delicate terminal work. Finally at this point make a backup of your Windows installation if you care for it. You can use Winclone (free software) for the back up or at minimum set a restore point for Windows to get back to that version if you screw up the next step. Restore points can be set when you enter the program section where you find all the Windows internal backup and restore stuff.

    There are reports that the MP3,1 model from 2008 cannot be put into AHCI mode normally. But some users succeeded by exchanging their optical drive from IDE to SATA or removing it completely before trying to boot Windows from the ODD-SATA ports. So it is recommended to take out any IDE drive.

    4. A refresher about other drivers

    When you have installed Windows load your Apple related drivers from the hybrid Leopard disk. All Leopard disks have a Bootcamp driver image on them which is acessible under Windows only. For 64-bit Windows you need to execute Bootcamp64.msi with admin rights. You find it in the drivers/apple folder on the leopard/SL disk. If it is not there you have a very old version and need to source those drivers somewhere from the internet. There are torrents and downloads from rapidshare available. Google Bootcamp 2.0.1 for that. In Win7 you have to apply the compatibility patch to Vista drivers before you can load the program. To get to compatibility mode right click the file and select the routine for compatibility. When you are done with the general Windows drivers and have installed all the Windows updates you will still need to activate the AHCI drivers for optimum performance. They will not be running at that stage.


    5. This is the actual installation

    5.1 Editing the registry

    Now in case we use Vista or Seven we are going to edit the Windows registry as directed by Ludachris. This only needs to be done in Vista and Seven but not in XP because XP has no MS AHCI driver in the standard.

    This does not yet activate the AHCI driver. If you have pre loaded the Intel driver during the Windows installation it will load a better Intel legacy driver instead of the slow IDE. You can shut down and restart Windows now.

    5.2 Installing the driver

    After this reboot comes the tricky part. We will force Windows to take an AHCI driver, which it normally rejects and we will patch the master boot record (MBR) of the drive that holds the Windows installation.

    In Windows device manager go to IDE/ATA devices. 2006, 2007 and 2008 Mac Pros have one device for the SATA ports; so its no question which to use. 2009 machines have two separate devices for the ODD and the HDD ports. Select the 4 port HDD device for the AHCI updating. Click properties and update the legacy driver to either the Microsoft or the Intel AHCI driver. It doesn't really matter which one you use. This AHCI installation cannot be done in automatic driver search mode. You have to tell Windows to look in the IDE ATA controller category for them. To find the MS AHCI 1.0 driver in Vista and Seven go to the manufacturer selection and look for Standard. You will have to scroll down to find it. For XP you have to load the Intel driver from from the Intel manufacturer list. If you havn't pre loaded the Intel drivers you should now use the Floppy utility you downloaded. Load these files from USB floppy or USB stick by clicking the have disk option. For pre 2009 you need to select the ESB2 driver. For Nehalem use the ICH10R driver. After this you must not reboot into Windows until you have patched the MBR. Force Windows to take this driver even if it thinks it is incompatible. It actually is but we will soon take care of this with the patch.

    5.3 Patching the MBR in OS X

    The next step is executing Johnsock's script to patch your MBR. This patch is absolutely necessary for every Windows. Pay particular attention to patch the right disk!!! If you patch an OS X disk that holds no Windows you are in serious trouble. The wrong disk selection will screw up your disk count and nothing will work right from there.

    In OS X open the terminal utility. Type "sudo" and a blank. Then drag the unzipped script shell file into the terminal with your mouse. Input your admin password and follow the dialogue.

    For this you will need the disk codes that you have noted on paper. The program tries to find your Windows disk but you have to make sure it finds the right one. It often suggests a wrong disk. Be really carefull to insert the complete name for the disk!! In our example it was /dev/disk2 for the second disk. Just inserting the number like 2, 0 or 3 or disk3 or disk4 will not work.

    When you are done with patching your MBR the program will confirm to you that you were successfull. You shut down OS X and restart Windows. If you have done the patch right and selected the right controller for your chipset Windows should now show SATA drives and get busy to find the real AHCI drivers for them. If you installed MS AHCI 1.0 you can now switch to the Intel driver without problems. If you got it wrong Windows will malfunction with a BSD on loading. You can use special load options to go back to the last known good configuration which you hopefully established by setting the restore point or you can restore Windows by Winclone. Start all over with the registry edit until you got it right.

    5.4 Installing the Intel Matrix Storage Manager

    To load the Intel Matrix storage driver you can now execute the Intel executable package which we downloaded. It will be accepted by your machine. If you try installing that package before the patch it will tell you that you are loading a wrong package for your machine. Restart Windows after the storage driver has completely installed. In Vista and Win7 you have to run the executable as administrator. Now you should be all set.


    6. Trouble shooting

    What to do if you patch the wrong drive? I happened to patch my OS X drive which was partitioned in three partitions of which one was NTFS. So the patch program thought I had a Windows on it. I did not check it and so I went ahead and patched it. It turned out to be real bad news because now as long as this drive is in the system I get BSD and the patch method does not work any more.

    I went back to the thread at Insanelymac and Johnsock had left instruction how to recover the backup MBR. It is stored in USERS/Yourname/backup.mbr

    Johnsock advised to run in terminal:

    sudo fdisk -y -u -f ./path/to/backup.mbr /dev/rdisk0

    But that command is designed for drives with one partition I guess. So I modified my command to:

    sudo fdisk -y -u -f /Users/gugucom/backup.mbr /dev/rdisk0

    That command worked for me.


    Feel free to challenge everything I have written here. I have only limited experience and will like to discuss any questions you have as good as I can. I tought the issue deserves its own thread so that we can collect the wisdom of all users here.
     

    Attached Files:

  2. rtrt, Aug 6, 2009
    Last edited: Aug 13, 2011

    macrumors 6502a

    Joined:
    Jan 19, 2008
  3. thread starter macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
    #3
    I had to find out about the AHCI driver in order to run my Blu-Ray ROM from the ODD-SATA ports. I never tried to boot from there but I guess you will have to fit the AHCI driver to do in Windows.
     
  4. thread starter macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
    #4
    I did a lot of debugging today because I went through it all again. ;) :rolleyes:
     
  5. rtrt, Sep 13, 2009
    Last edited: Aug 13, 2011

    macrumors 6502a

    Joined:
    Jan 19, 2008
  6. macrumors member

    Joined:
    Jan 14, 2008
    #6
    Got so frustrated with trying to get it working on my 2008 MacPro a while back, I just abandoned it since all I wanted was BluRay playback.

    Enter PS3 :)
     
  7. thread starter macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
    #7
    I really had to do it several times to write a half decent tutorial. There were several really bad descriptions in the first version. Sorry for that....

    I even got it figured out for my MacBook Pro. On that I can only run MSAHCI 1.0 but it is way better than the legacy. Perhaps I will find the NVIDIA AHCI driver for my uMBP.
     
  8. macrumors member

    Joined:
    Jan 14, 2008
    #8
    No worries man, thanks for providing the information.
    I'll probably give it another shot once I install Windows 7 on an external drive soon....
     
  9. thread starter macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
    #9
    Be advised that Intel released the version 8.9 for Win7. The other versions officially do not support Win7.

    Versions under 8 do not support Vista.
     
  10. macrumors newbie

    Joined:
    Oct 19, 2009
    #10
    Unibody MBP and AHCI

    You got it working on your unibody MBP? - Really strange because I cannot. Modifing the MBR does not trigger the AHCI drivers to be installed, and I get BCD when trying manually. Do you have any additional info on how tho get AHCI on unibody MBP's ?
     
  11. thread starter macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
    #11
    Actually the order of things is generally the other way round. You force an AHCI driver which would cause a BSD if you would start Windows unmodified. Then you do the MBR patch and this will make Windows start with the AHCI driver without a BDS.

    I could never find a Nvidia chipset driver which has a similar function as the Intel driver but in Vista and Seven you do get the MSAHCI 1.0 driver which isn't too bad.
     
  12. macrumors 6502

    JPamplin

    Joined:
    Mar 12, 2009
    Location:
    Nashville, TN
    #12
    @Gugucom,

    I've already installed and activated Win7 on a dedicated drive in Bay 4 of my MacPro4,1 - Win7 is running, but the hard disk seems slower than it should be. I'm running Win7 Pro 64-bit.

    1. Would the AHCI driver increase drive performance?
    2. Is it possible to install these drivers after Win7 is installed? I.E., change the driver in Device Manager? I don't want to have to reinstall Win7 and use another activation (I think they count them) if the answer to 1) is "not really."
    3. I've read about data loss with Intel's 8.9 driver set - anyone see this?

    Any help would be very... helpful.
     
  13. thread starter macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
    #13
    I would say that it would do with 99,99% certainty.


    You can install the AHCI driver at any stage of the Windows driver installation or updating process. That goes for XP and all 32 and 64-bit versions of Vista and Seven.

    Just changing the driver in device manager will BSD your system on reboot. You need to mod the registry (Vista and 7 only) and patch the MBR in OS X with the terminal script.

    Installing AHCI drivers has no impact on activation, unless you mess up and have no backup. Then you would have to start from scratch and activate. Even then activation should go without a hitch as the relevant hardware would be reported as identical. Having a Winclone or Windows internal backup makes much sense though. At minimum you need to set a restore point.

    Actually Intel received reports of frequent drive failures under 8.9 and changed their recommendation to 8.8 for all older Windows systems. They still recommend 8.9 for Windows7 though.

    I have Windows Vista and Seven running on 8.9 on HDD and SSD and had no problems.
     
  14. macrumors 65816

    Infrared

    Joined:
    Mar 28, 2007
    #14
    Bays 3 and 4 are reportedly problematic for the 2009 Mac Pros.

    Could you try the drive in bay 1 or 2?
     
  15. macrumors 65816

    Infrared

    Joined:
    Mar 28, 2007
    #15
    Do you have a link, please?

    Windows 7 x64 with 8.9 here and no obvious issues.
     
  16. thread starter macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
  17. macrumors regular

    Joined:
    Jul 28, 2007
    #17
    One question,
    Do I have to format my existing windows Vista??
    This thing is really confusing me...... :confused:
     
  18. thread starter macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
    #18
    No, but you better make a backup before you start the installation. I will divide the Posting up into sections and mark the actual installation section.
     
  19. macrumors regular

    Joined:
    Jul 28, 2007
    #19
    So in simple words,

    1- Registry, Restart.
    2- Microsoft drivers autoload, after all drivers are set restart to Mac.
    3- Do the patch, Restart to Windows.
    4- Install intel drivers, then restart in Windows...

    ALL SET ;)
     
  20. thread starter macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
    #20
    Sure, but I have seen all kinds of experienced people struggle with this.
     
  21. macrumors member

    Joined:
    Oct 15, 2009
    #21
    Awesome.. question

    This is a great guide, thank you gugucom!

    For those who have thought about this longer than I have, is it likely that this procedure could break something if MS updates ACHI driver support under Win 7 in the future? I haven't taken a look at the script but wonder what the MBR patch is doing, exactly..
     
  22. macrumors 6502a

    Joined:
    Feb 18, 2009
    Location:
    Cali
  23. thread starter macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
    #23
    For those who are interested in the background of Johnsock's patch I quote his original post from insanelymac.com
    http://www.insanelymac.com/forum/index.php?showtopic=126089&st=40#
    Remember that this describes an early rudimentary job which he later refined for various Windows versions with Ludachris. The method is based on an earlier program written by pipomolo42 for the GRUB boot loader.

    I think that this method is very likely to be unaffected by any changes MS makes in the near future. It covers Win systems spanning six or seven years and works on all of them.
     
  24. macrumors member

    Joined:
    Oct 15, 2009
    #24
    Will Intel ACHI mod kill 7's support for TRIM in SSDs?

    I'm exploring my options for SSD with TRIM implementation in Win 7, and I just read this over at the Anandtech forums, which gave me pause:

    "There are significant limitations to TRIM at this point. The instruction only works in a supported OS (Windows 7 and some Linux builds) and only with supported drivers. Under Windows 7 that means you have to use a Microsoft made IDE or AHCI driver (you can't install chipset drivers from anyone else)."

    At face value, this would indicate that Win 7 dual booters are going to lose support for TRIM if they replace the MS drivers with Intel's, right? Crap.

    Then again, from gugucom's description of the legacy drivers installed on Mac Pro systems by Windows 7, I wonder if TRIM support is present at all?
     
  25. thread starter macrumors 68020

    gugucom

    Joined:
    May 21, 2009
    Location:
    Munich, Germany
    #25
    I think the more important issue in Windows is the defragmentation option. If you have enabled defragmentation you will quickly damage your SSD because it is not designed to be defragged.

    Windows SATA driver in Bootcamp standard is MS and not Intel. With TRIM and AHCI it means you can only use Vista and Win7 which come with an MS AHCI 1.0 driver in the standard. XP does not naturally have the AHCI driver. MS AHCI will be less performant than an Intel driver. But if TRIM gives you additional performance advantages it may be justified to use it. It is certainly not a problem to install.

    Anand says that Intel are going to fix the issue with 32nm TRIM software expected to be released in the current quarter. That is one more reason to use the Intel 2nd Gen SSDs. They are superior even without TRIM and are max compatible with RAID cards.
     

Share This Page