An IMMENSE thank you to panreyes and ilko! Your fix finally put an end to endless frustration on my part.
My motherboard is a GIGABYTE GA-970A-UD3. I run Windows XP.
For months I had a very annoying problem : XP would recognize the hard drives connected to the SATA ports 0-3 of the motherboard, but not those connected to the ports 4 and 5. These last two would not appear in the disk manager (diskmgmt.msc) nor the device manager (devmgmt.msc), yet they were detected in the BIOS. These two drives worked fine on another computer, and the SATA cables were good too. When I switched the SATA cables, the new drives connected to ports 4 and 5 would be the ones not recognized in Windows, while those that were previously not recognized appeared.
Then I noticed in the BIOS these two lines :
OnChip SATA Type [Native IDE]
OnChip SATA Port4/5 Type IDE
The second line was grayed out, which according to the manual is because "this option is configurable only when OnChip SATA Type is set to RAID or AHCI". The reason why it wasn't working as IDE is beyond me, but I thought I might as well try with AHCI and see if Windows would recognize the drives then. It's not as if I had any idea what else to do, endless googling didn't help me find a solution to my problem.
So I downloaded the AMD SATA RAID/AHCI driver from the GIGABYTE website, but then all the tutorials I found to switch from IDE to AHCI on XP weren't working. Whenever I tried to update the driver for any of the IDE ATA/ATAPI controllers from the device manager I would get the message "The specified location does not contain information about your hardware."
Then I found this topic! At first the .bat file I made from panreyes's post http://reboot.pro/to...-ahci/?p=149761 didn't work, the keys wouldn't get added to the registry, but then I realized that for some reason all the backslashes in this topic are missing. I tend to think the problem is on this site's side rather than on my side but then I wonder why no one mentioned it before.
So here is the correct .bat file with all the needed backslashes :
reg add "HKLM\SYSTEM\CurrentControlSet\Services\ahcix86" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\ahcix86Enum" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\ahcix86" /v Type /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\ahcix86" /v Start /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\ahcix86" /v Group /t REG_SZ /d "SCSI miniport" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\ahcix86" /v ErrorControl /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\ahcix86" /v ImagePath /t REG_SZ /d "system32\drivers\ahcix86.sys" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\ahcix86" /v tag /t REG_DWORD /d 4 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#VEN_1002&CC_0106" /v Service /t REG_SZ /d "ahcix86" /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#VEN_1002&CC_0106" /v ClassGUID /t REG_SZ /d "{4D36E97B-E325-11CE-BFC1-08002BE10318}" /f
To be sure that the keys are added to the registry without error, launch a cmd prompt and run the .bat from there, otherwise if you run the .bat directly the cmd prompt opens and closes instantly and you don't have the time to see if any error occured.
Then as panreyes mentioned I copied the files ahcix86.sys, ahcix86.inf and ahcix86.cat that I got from GIGABYTE's website to c:\windows\inf, and ahcix86.sys to c:\windows\system32\drivers , and I rebooted. I went directly into the BIOS before starting windows, and I changed the OnChip SATA Type to "AHCI" and the OnChip SATA Port4/5 Type to "As SATA Type".
And then it worked!! Windows XP detected right away the drives connected to the SATA ports 4 and 5 of my motherboard! Then the hardware update wizard showed up, if I recall well I selected "Install the software automatically", then it prompted me for the file ahcix86.sys, I browsed to c:\windows\system32\drivers , once installed it asked me to reboot one last time and voilà all good! Like doveman it appears in the device manager under SCSI and RAID controllers, as "AMD AHCI Compatible RAID Controller".
Hopefully this post will help someone who runs into the same issue as mine.. A huge thank you once again to everyone who posted in this thread!