[comp.os.msdos.programmer] DMA questions.

ps2x+@andrew.cmu.edu (Peter John Skelly) (02/22/91)

Does anyone know if it is possible to program the dma chip used in pc's to
do memory to memory copies.  I've heard both ways, but if someone knows for
sure either way, I'd like to know.

If it is possible, some suggestions on how would be useful.

Peter Skelly

Ralf.Brown@B.GP.CS.CMU.EDU (02/22/91)

In article <8bl2yqS00WB401Skhj@andrew.cmu.edu>, Peter John Skelly <ps2x+@andrew.cmu.edu> wrote:
}Does anyone know if it is possible to program the dma chip used in pc's to
}do memory to memory copies.  I've heard both ways, but if someone knows for
}sure either way, I'd like to know.
}
}If it is possible, some suggestions on how would be useful.

My understanding is that memory-memory DMA is only possible using channels 0
and 1, and channel 0 is used for DRAM refresh.	That would make things rather
tricky even if possible at all.
--
{backbone}!cs.cmu.edu!ralf  ARPA: RALF@CS.CMU.EDU   FIDO: Ralf Brown 1:129/3.1
BITnet: RALF%CS.CMU.EDU@CMUCCVMA   AT&Tnet: (412)268-3053 (school)   FAX: ask
DISCLAIMER?  Did  | It isn't what we don't know that gives us trouble, it's
I claim something?| what we know that ain't so.  --Will Rogers

wahlsten@elixir.lne.kth.se (Jorgen Wahlsten) (02/23/91)

In article <8bl2yqS00WB401Skhj@andrew.cmu.edu> ps2x+@andrew.cmu.edu (Peter John Skelly) writes:
>Does anyone know if it is possible to program the dma chip used in pc's to
>do memory to memory copies.  I've heard both ways, but if someone knows for
>sure either way, I'd like to know.

With a PC it will be hard... There is only four DMA-channels (0 to 3)
and one can only use DMA-channels 0 and 1 (together) to do memory to
memory copies. Unfortunatly they are already used to do memory-refresh...

But isn't it two DMA-chips inside an AT ?!? If so one would be able to
use DMA-channels 0 and 1 in the second DMA.

bmarsh@cod.NOSC.MIL (William C. Marsh) (02/26/91)

In article <27c52136@ralf> Ralf.Brown@B.GP.CS.CMU.EDU writes:
>In article <8bl2yqS00WB401Skhj@andrew.cmu.edu>, Peter John Skelly <ps2x+@andrew.cmu.edu> wrote:
>}Does anyone know if it is possible to program the dma chip used in pc's to
>}do memory to memory copies.

>My understanding is that memory-memory DMA is only possible using channels 0
>and 1, and channel 0 is used for DRAM refresh.	That would make things rather
>tricky even if possible at all.

Unless you need the CPU for something else (Or if you are on a PC rather than
an AT), it is much faster to do memory-to-memory copies with a repeated movsb
(or movsw) command.  The DMA controllers clocks are only at about 400 Khz, so
that limits the speed of DMA transfers.  And, each memory-to-memory transfer
will take two DMA cycles, further diminishing speed.

As an aside, that's why the AT doesn't use DMA for the hard disk access, they
use a repeated input instruction.  The newer bus-master interfaces, (i.e. the
adaptec SCSI board), has it's own DMA controller built onto the board, and it
is capable of a lot faster DMA that what is present on the motherboard.

Bill
-- 
Bill Marsh, Naval Ocean Systems Center, San Diego, CA
{arpa,mil}net: bmarsh@cod.nosc.mil
uucp: {ihnp4,akgua,decvax,dcdwest,ucbvax}!sdcsvax!nosc!bmarsh
"If you are not part of the solution, you're part of the problem..."