Windows XP and AHCI

Currently, AHCI is the standard interface between a host and SATA storage devices. Windows XP does not come with a built-in AHCI driver which may prevent it from detecting a computer's storage device. I describe a common solution to this problem and how it worked out for me.

For several years now, serial ATA (SATA) has been the standard interface for hard disk, solid-state, and optical drives in consumer desktop computers. The communication over SATA can be carried out with AHCI or by having the SATA controller pose as parallel ATA (PATA) device. In comparison to PATA, AHCI provides hot swapping capability and native command queuing where the connected drive may reorder operations comparable to out-of-order execution for microprocessors. In general, it is recommended to favor AHCI over PATA although PATA may be faster on some hard disk drives for some synthetic benchmarks.

Windows XP does not have a built-in AHCI driver so when installing WinXP on a SATA storage device, the device needs to be either permanently in PATA mode or an AHCI driver needs to be supplied during the installation and this is where the problems start. The WinXP installer can only access CD-ROM and floppy disk drives so unless a computer has a second CD-ROM drive or a floppy disk drive, one is stuck.

The solution for this problem is to add an AHCI driver to the WinXP installation medium. This is called "slipstreaming" and supported by Microsoft because it eases, for example, the installation of an up-to-date Windows version on many computers for administrators. Slipstreaming can be used to patch a Windows installer with service packs, updates, and additional drivers. There are many guides on the internet that explain this process as well as software performs the necessary operations. Slipstreaming (manual or automated) requires a working Windows installation which causes a chicken-and-egg situation for WinXP with AHCI enabled because the installer requires an AHCI driver which has to be added to the installer. The circle can be broken by temporarily using PATA mode or by temporarily running Windows in a virtual machine on an operating system that supports AHCI natively.

Recently, I installed Windows XP with a slipstreamed AHCI driver on my computer with SATA storage. First, I enabled the PATA mode of the SATA controller in the BIOS, then I installed Windows XP. After copying my WinXP CD onto the desktop, I used nLite to slipstream service pack 3, all updates, and my mainboard manufacturer's AHCI driver into my WinXP copy. Rufus copied the resulting disk image onto a USB stick and made it bootable. After rebooting, I set the SATA controller to AHCI mode and started the WinXP installation again. This worked for me except that Windows took about 30 seconds to boot which I felt was quite long for a modern computer with solid-state disk so I analyzed the boot process with Bootvis. Indeed, Windows was idling for about 15 seconds during disk initializtion and after loading the AHCI driver. It turns out, when booting, Windows XP is looking for IDE drives by default. This can be disabled but I was still stuck with Windows idling for about six seconds.

Note the PATA mode of an SATA controller may be called "IDE mode". For an explanation of the differences and commonalities between PATA and IDE, look here and here.