If you want to get the most out of your ATA devices, you have some work ahead of you

In "Maximizing ATA Disk Performance, Part 1," January 2002, InstantDoc ID 23297, I showed you how to obtain the best possible performance from ATA (aka IDE) disks in Windows 2000. I described the market's latest ATA standards and discussed some hardware pitfalls that you might experience while attempting to properly configure your ATA disks (e.g., ATA/33, ATA/66, ATA/100). This month, I conclude my two-part series with a discussion of software. I also attempt to fill in some of the information gaps in Microsoft's spotty Knowledge Base documentation about ATA. But before you implement this column's steps or advice, be sure that you've completed last month's hardware-specific steps.

A Little Perspective
To gain some perspective on the evolution of ATA disks under Win2K and Windows NT, you need to know a bit of history. Original IDE/ATA specifications used a data-transfer method called Programmed I/O (PIO), which relied heavily on the system CPU to handle data transfers from a disk's cache memory to system memory. The first PIO modes of operation (0, 1, and 2) fell under the umbrella of the original ATA standard. The later ATA-2 specification (aka EIDE or Fast ATA) included two new and faster PIO modes (3 and 4), as well as two modes that used direct memory access (DMA). By providing a less CPU-intensive data-transfer method, DMA addressed the burden that PIO imposed on the system CPU. To facilitate data-transfer operations, DMA also gave the IDE controller direct access to system memory. (Other controller types, including SCSI and Ethernet adapters, also use this methodology.) DMA eventually became the current ultra DMA (aka Ultra ATA, ATA/33, or DMA-33) standard, which supports a new mode called DMA Mode 3. This standard became so prevalent in the industry that the term UDMA—which refers to a data-transfer mode rather than a disk interface standard—is interchangeable with ATA in discussions about modern ATA disks (e.g., ATA/33 and UDMA/33, ATA/66 and UDMA/66). Also, for reasons of backward compatibility, modern ATA disks can support all data-transfer modes—including PIO and DMA—to their maximum capabilities.

Early UDMA disks and controllers were capable of operating at speeds of 33MHz, which meant that they could theoretically transport data at a maximum burst rate of 33MBps. Over time, enhanced and updated versions of UDMA supported operation at 66MHz/66MBps (ATA/66), using DMA Mode 4, and at 100MHz/100MBps (ATA/100), using DMA Mode 5. Virtually all the ATA disks available today are ATA/66 or ATA/100. These new capabilities have provided ATA with performance capabilities previously exclusive to SCSI disk subsystems and narrowed the gap between the ATA and SCSI standards. Also, because of ATA devices' lower price point, ATA has become preferable to SCSI for all but the most demanding applications (in which SCSI still holds some performance advantages).

Driver Developments
Despite these advancements in ATA technology and the ubiquitous presence of ATA disks in today's PCs, Win2K and NT are notoriously bad at optimizing the performance of ATA devices. Under NT, the root of this problem is the driver model that Microsoft implemented for ATA disks. Microsoft provided one pseudo-SCSI miniport driver—atapi.sys—which combines with scsiport.sys to form a pseudo-SCSI driver that supports all ATA devices on the system. This one-size-fits-all setup works fairly well and doesn't exact any significant performance penalties for older IDE controllers and devices. However, the atapi.sys driver often hamstrings newer controllers and devices because it doesn't take advantage of those devices' advanced PIO and DMA operation modes. Although several NT service packs provide atapi.sys new abilities to take advantage of the newer transfer modes, third-party drivers are still necessary to ensure optimum performance.

Under Win2K, Microsoft changed the ATA driver model from one that used atapi.sys as a monolithic, pseudo-SCSI miniport driver to one that implements a full-blown port driver (similar to scsiport.sys) for ATA. As a result, vendors can now implement specific enhancements (e.g., DMA, busmastering) in special MiniIDE drivers. Therefore, the OS can leverage each controller's special capabilities.

Although Microsoft has greatly improved the support for newer ATA controllers in Win2K, many ATA-support problems remain—particularly regarding support for the most recent DMA Mode 4 and 5 (ATA/66 and ATA/100, respectively) data-transfer methods. These problems are unfortunate because fully realizing the capabilities of ATA/66- and ATA/100-capable devices is impossible without enabling these DMA data-transfer modes.

ATA in Win2K
When Win2K first shipped, Microsoft's default atapi.sys driver included support for ATA data-transfer modes up to and including UDMA/66, which was the fastest standard in widespread use. However, Microsoft chose not to enable the most aggressive mode (UDMA/66) as the default setting on many systems that had Intel-based ATA chipsets (which are the most commonly implemented chipsets in modern PCs). Ostensibly, Microsoft made this choice to prevent data corruption and similar problems with certain disk, controller, and driver combinations. However, few people knew about or understood Microsoft's decision. Then, Microsoft published "HOWTO: Enable UDMA66 Mode on Intel Chipsets" (http://support.microsoft.com/default.aspx?scid=kb;en-us;q247951), and users became aware that Win2K wasn't automatically enabling the UDMA/66 setting. The article shows users how to remedy the situation by modifying the system registry. However, the article provides no guidance about important specifics such as which Win2K service packs, Intel chipsets, and disks this default configuration setting affects. Also, the article fails to address how the setting relates to UDMA/100 or non-Intel chipsets.

The situation became even murkier when Microsoft released another ambiguous ATA-related article: "Support for ATA 100 (Mode 5) in Windows 2000" (http://support.microsoft.com/default.aspx?scid=kb;en-us;q260233). This article states that Win2K Service Pack 2 (SP2—or a pre-SP2 hotfix) addresses Win2K's failure to support ATA/100 (aka DMA Mode 5). Unfortunately, this article also lacks crucial information about the problem, such as which ATA chipsets it affects (i.e., Intel, non-Intel, or both), how the problem relates to the aforementioned ATA/66-related fix, and what service pack levels the pre-SP2 hotfix version of the remedy affects (i.e., base release or SP1). Even today, Microsoft provides no concrete guidance about these topics, and although you can find relevant articles on the Internet, those articles come primarily from non-Microsoft sources and are based on anecdotes rather than hard facts.

If you have the precise type of system that Microsoft is targeting in its articles, then the recommended registry modification and SP2 installation might be all you need to enable ATA/100 support on your system. If the article's tips don't apply to your system, the best-case scenario is that the modifications will have no effect; the worst-case scenario is that the modifications will cause system errors and data corruption.

Third-Party Drivers to the Rescue
None of the aforementioned Microsoft articles mention that these ATA-support problems are specific to the default atapi.sys driver, nor that users might be better served by using third-party drivers specific to the chipset in use. Third-party drivers often circumvent most of the aforementioned problems and take full advantage of the chipset's capabilities. In many cases, the drivers' installation routines automatically configure the system (including any necessary registry settings) to properly take advantage of the fastest ATA modes that the chipset supports. Unfortunately, although most system and ATA chipset manufacturers provide drivers for their ATA controllers, most users are either unaware of their existence or fail to install them.

One example of a third-party ATA chipset driver is the Intel Ultra ATA Storage Driver, which you can obtain from http://support.intel.com/support/chipsets/storagedrivers/ultraata. This site not only contains Ultra ATA drivers for Win2K and other Windows OSs—with full support for all ATA data-transfer modes—but also contains a chipset-configuration utility that helps you ensure that Win2K properly recognizes your ATA chipset. Other chipset manufacturers, such as VIAHardware.com, also produce custom Win2K drivers for their controllers. A final benefit of third-party drivers is that some of them include utilities to not only properly configure and enable advanced ATA data-transfer modes but also identify which PIO or DMA modes various ATA channels and devices are using. Win2K attempts to provide similar information—for example, you can go to Device Manager, open the ATA channel's Properties dialog box, and select the Advanced Settings tab. However, Win2K's information lacks details and in some cases—such as in the hotfix discussed in the Microsoft article "Device Manager Lists ATA-100 Device Incorrectly as Using PIO Instead of UDMA" (http://support.microsoft.com/default.aspx?scid=kb;en-us;q269555)—Win2K displays incorrect information.

To maximize the manageability, reliability, and performance of your ATA devices in Win2K, you'll need to do a little research and legwork. Remember that each system is different, with different controllers, chipsets, disk brands and models, ATA specifications, and drivers. Ensuring that you have the proper mix of system hardware, OS updates, and—if necessary—third-party drivers can be a complicated job. With a bit of elbow grease, however, you should be able to get your ATA devices operating at peak performance.