Page 1 of 1

How to access hdd using dma?

Posted: Mon Dec 12, 2005 2:00 am
by Abdo
why is the most tutorials on net about hdd read&write uses direct I/O? I want to use dma to access hdd. How can I do that? Any tutorials, link or explanations appreciated... Thanks

Re:How to access hdd using dma?

Posted: Mon Dec 12, 2005 2:40 am
by Solar
Isn't HDD DMA part of handling the PCI bus? I'd guess when you're doing your PCI driver, you are (or should be...) past the "tutorials" stage and able to go by technical specs...

Re:How to access hdd using dma?

Posted: Mon Dec 12, 2005 2:40 am
by pradeep
A PCI hard disk consist of its own DMA, Is it possible for the hard disk to use both the DMA's? If so can we use both of them at the same time?

Re:How to access hdd using dma?

Posted: Mon Dec 12, 2005 2:58 am
by Candy
Try searching for the pci ata hdd host adapter standard. I found it once, iirc it explains what you want to know. Good luck.

Re:How to access hdd using dma?

Posted: Mon Dec 12, 2005 6:27 am
by Pype.Clicker
i strongly recommend you google for ATADRVR.ZIP by Hale Landis ... it contains public domain commented code for accessing ATA disks and ATAPI devices in any mode you can think of: PIO, ISA DMA, PCI DMA (aka busmastering DMA or 'ultra DMA') and will point you to additionnal reference when needed.

Re:How to access hdd using dma?

Posted: Tue Dec 13, 2005 5:22 am
by Xardfir
DMA (using the PC's DMA chip) was used on old IBM XT hard disks. With the AT, direct access (Programmed I/O - PIO) by processor was soo much faster that they removed the DMA channel. The DMA controller is now only used for floppys and some ISA sound cards. If you are thinking of using 8237 DMA don't, you physically can't connect a hard disk to the DMA chip anymore.

From the early 90's when PCI became available, Busmastering DMA is used. For this to work, you need to know the registers for the chipset you are using.
Search the PCI bus for the Device and use the appropriate driver or fall back on PIO mode (discussed in the above ATA documents).
Unless you use the PCI busmastering PIO is the only way to access the hard disk. This document describes the PIIX and the PIIX3 that are probably the most common chipsets in use (with Intel processors anyway):
http://www.intel.com/design/chipsets/da ... 055002.pdf
I'm not sure about the VIA interface though. http://www.via.com.tw
You still need to check if the hard disk supports DMA to enable it, and even if it does, if another device on the same cable will allow it. (Think a CD and a DVD on the same IDE cable. The cable speed defaults to the slowest device, most likely PIO mode 4 even if the DVD supports DMA transfer.)
Hope this helps!

Re:How to access hdd using dma?

Posted: Wed Dec 14, 2005 6:12 am
by Rob
The archive mentioned above seems to be downloadable from:

http://www.ata-atapi.com/products.htm