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 UDMAwhich refers to a data-transfer mode rather than a disk interface standardis 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 modesincluding PIO and DMAto 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 driveratapi.syswhich 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 remainparticularly 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.