Number 201 - February 2000
Soup Up Your Hard Drive with DMA
by Fred Langa, Winmag December 6, 1999
    Holy smokes! Several weeks ago in my newsletter, I suggested that readers check to see if their hard drives were set up to use DMA--direct memory access--because using DMA can reduce the load on your CPU by up to 40 percent during disk operations: For the price of one simple mouse click--that is, for free--you can get a significantly faster, more responsive system.

    In fact, when I activated DMA disk access on my system, I saw an immediate 15 percent increase in hard drive speed with no ill effects whatsoever. Many, many readers reported similar or even greater increases. Not too bad for a one-minute tweak, eh?

    Today's column actually picks up where my newsletter item leaves off, but that column is too long to reprint here. If all this DMA business sounds foreign to you, please take a minute to read the Nov. 26, 1999 issue Click here, 1999 Back Issues, Nov. 26 and read the Nov. 29, 1999 issue Click here, 1999 Back Issues, Nov. 29; those links explain what's going on and tell you the basics of how to enable DMA on any standard PC of reasonably recent vintage.

    But -- and there's always a "but" -- there are many potential glitches, and the more I looked into this, the more potential glitches I found. I still recommend that you use DMA if it's at all possible to do so because the improvements are so impressive. But you need to have your eyes open. Let me explain:

    Hard drives normally use one of five ways or "modes" of shuffling data. The older way is called "programmed input/output" (PIO) and it comes in three major flavors with speeds ranging from 5.2MB/s to 16.6MB/s. The primary strength of PIO mode is that it's nearly universally supported--it'll work on just about all systems, all the time.

    The other two common modes are Multi-Word DMA (which also operates at 16.6MB/s) and UDMA, where the "U" stands for "ultra;" it can zip along at 33.3MB/s.

    And just so you'll know, there's a new 66MB/s version of UDMA that's shipping in some drives today. These "UDMA/66" drives are not yet common, but they're out there.

    So, UDMA and UDMA/66 are inherently much faster than any of the PIO modes. But even standard DMA at 16.6MB/s will net out faster than 16.6MB/s PIO because DMA reduces the load on the CPU, letting the system do something besides just waiting on the hard drive. If you can use DMA or UDMA, it almost always makes sense to do so.

    That's almost always: There are exceptions. For example, most PCs come with two IDE "channels" to connect hard drives, ZIP-type drives, and CD ROMs (including CDRs and CDRWs) to the system; each channel supports up to two devices. (That's why typical hard drive cables have two places to attach things.) DMA can only be turned on or off for each channel/cable as a whole, so changing the DMA setting for a channel affects all the devices on that channel.

    Thus, if you have a hard drive and a CD on the same cable and if you set the hard drive to use DMA, you're also automatically setting the CD to use DMA--and some CDs work very poorly with DMA turned on. In fact, some makers of CDRs and CDRWs specifically recommend against using DMA modes. For cases like these, you have to segregate your storage devices so those that can use DMA share one cable and those that don't are on the other.

    But that's not the only issue because not all PCs support DMA or UDMA in the first place. For any flavor of DMA to work, the drive, the motherboard, the BIOS and the OS all must be DMA or UDMA capable. For UDMA/66 to work, you also need a special 80-pin cable as well. Just having a DMA or UDMA drive isn't enough--the entire system has to support the mode you want to use, or the drive will revert to a slower mode, possibly all the way back to PIO.

    There's not a lot I can tell you about your own hardware -- the potential number of motherboard/BIOS/cable/disk combinations is staggering. If you're unsure about your systems' DMA or UDMA capabilities, visit your system vendor or hard drive maker's Web site, and see what they have to say.

    But I can tell you about Windows: Windows 95 and NT4 both need a patch or upgrade to support DMA/UDMA. Windows 95 SR2 supports DMA natively, but needs an upgrade to support UDMA. Windows 98 and the current Release Candidates for Windows 2000 natively support both DMA and UDMA. (See the links at the end of the article for Microsoft pages that can help you track down any patches you need; try your hard drive vendor's Web site, as well.)

    There's not a lot of information on UDMA/66 yet, but chances are you'll need a special driver to get full speed from this type of hard drive: The special driver should either ship with the drive, or be available on the hard drive vendor's site. As mentioned earlier, UDMA/66 also needs a special cable; without both the special cable and the proper driver, the best your UDMA/66 drive will do is UDMA/33, or even standard DMA.

    OK, this is sounding very complicated, so before your eyes glaze over, let me stop here and reiterate: With the most common types of hard drives on reasonably recent PCs, you probably will be able to select DMA and immediately enjoy must faster, problem-free drive throughput.
    And in most cases, if you select the DMA option and it doesn't work for any reason, the system simply reverts back to the slower but ultra-reliable PIO mode, and that's that: no harm done. You then can try tracking down whatever it is--drive, cable, motherboard, BIOS, or OS--that's preventing DMA access from working. Thus, in most cases, you can try DMA with little risk. (Although, as I said in the original article, it's always good to have a current backup.)

    But sometimes, things can go awry: On some small number of systems, a DMA problem does not result in a graceful return to PIO mode. On these mostly-older systems, things can get rather nasty:     For example, you may find your system has become unstable; or you may find that your system is now actually slower than before. In extreme cases, you may be able to boot only to DOS (which always uses PIO mode); you won't be able enter Windows. While none of these outcomes is acceptable, the last case is the worse: If you can't even get into Windows, how can you fix the problem? (No, Safe Mode won't help; you can't modify fouled-up DMA settings from within Safe Mode.)

    So, if you're one of the unlucky ones who have a major problem in trying to enable DMA, what can you do?

    If you can get into Windows, the simplest fix may be to right-click My Computer, select Properties, then Device Manager. Open Disk Drives, highlight your hard drive entries, and the click "Remove." Next, open Hard Disk Controllers, and Remove your controller entries. Reboot; when the hardware is automatically redetected and reinstalled, the problem may resolve itself.

    If not, run Regedit, search for and entries referencing "IDEDMADRIVE." There'll typically be two: IDEDMADRIVE0 and IDEDMADRIVE1, although your system may be different. In any case, set the values of those entries to zero, save the edited Registry, exit, and reboot.

    If that doesn't work, and if you're running Win98, you're in luck: That OS normally automatically backs up your Registry once a day, upon reboot. You can use those backups to go back to a known-good, pre-foul-up copy of the Registry. It's easy: Boot to DOS. At the C:\ prompt, type SCANREG /RESTORE. Select the latest known-good Registry backup from the list of Registry backups you'll be shown. Reboot again, and all the DMA stuff should be gone. (For somewhat more detail on this process, see http://www.langa.com/newsletters/oct-28-99.htm. And see the list of additional resources at the top of this column for help with Win95's Registry.)

    And if that doesn't work, well, now you know why I suggested that you make a full backup. You can always restore your system (ideally, from DOS, to be sure the Registry gets completely overwritten) and get back to the way things were.

    I'm including all this troubleshooting information so you'll have it if you need it -- but chances are, with most systems of reasonably recent vintage, you won't have any trouble at all. Instead, with that simple click of the DMA option, you'll immediately begin enjoying faster -- even much faster -- drive speed.

    I hope this has helped you -- and now I hope you can help me. You see, there's more to the DMA business, and some of it I simply can't track down at all.

    For example, right click My Computer/Properties, then Device Manager, then System Devices, then Direct Memory Access Controller. Click the Settings tab and you'll see two options -- a way to reserve an arbitrary amount of memory for the DMA buffer, and a choice of two ways to restrict DMA transfers.

    I have no clue what these settings do, and a search of both the Microsoft Knowledgebase and the TechNet CD turned up exactly zero -- zilch, nada, nil--hits. Microsoft built these settings, but appears to be mute on how to use them. Can anyone tell me--tell us--what these settings do and what the optimal choices are?

    In fact, if you have any information to share on DMA, or if you have questions, please click on over to the discussion area! Let's pool out knowledge!

DMA/UDMA Info from Microsoft:

    What To Do If Your Drive Does Not Have a DMA Check Box
    support.microsoft.com/support/kb/articles/Q229/0/85.ASP

    What To Do If The DMA Check Box Does Not Remain Checked
    support.microsoft.com/support/kb/articles/Q159/5/60.asp

    General Info on Ultra DMA/UDMA66
   support.microsoft.com/support/kb/articles/Q232/5/45.ASP.
   http://www.microsoft.com/TechNet/win98/dma66dr.htm

    Windows 95 IDE Support DMA
    support.microsoft.com/support/kb/articles/Q154/4/35.asp (includes patch)

    What to Do if Your Win95 SR2 Computer with UDMA Hangs     support.microsoft.com/support/kbarticles//Q171/3/53.asp?PR=ALL&FR=0&M=S&

    DMA/UDMA/UDMA66 Info from Western Digital
(most is not specific to WD drives)
    http://www.westerndigital.com/products/drives/drivers-ed/udmatp.html
    http://www.westerndigital.com/service/tip_dir/tip0997.html
    http://www.westerndigital.com/products/drives/drivers-ed/ata66tp
    http://www.westerndigital.com/fitness/ata66issues.htm

Related Articles:
    DMA and your CD ROM Drive, One View     http://www.winmag.com/library/1998/1001/fea0045j.htm

    DMA and your CD ROM Drive, Another View     http://www.winmag.com/fixes/1999/0799/sol0071c.htm
  Number 201 - February 2000