[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DMA 4 meg v. 8 meg



Charlie <charlieDOTd@verEYEzon.net> wrote:

> On 5/6/2011 4:21 PM, Michael J. Mahon wrote:
> > In fact, it would be a *very bad* idea to create any Apple peripheral
> > that relied upon DMA to function. Since DMA discipline is so poorly
> > supported by most cards, DMA-using cards are almost all incompatible
> > with each other.
> 
> I also have an Apple HS SCSI card which I believe uses DMA.

The HS SCSI card can be configured to enable or disable DMA via one of
the DIP switches.

> So far they seem to be co-existing OK.  What should I be looking for in
> terms of incompatibility?

DMA devices can coexist peacefully in the Apple II as long as they only
use DMA to perform fast data transfers in a burst when requested by the
main CPU, and then not in multitasking contexts (such as interrupt
handlers).

For example, two different cards which act as storage devices and only
do DMA to perform block read/write operation under control of the
operating system, since the OS can only do one data transfer at a time.

What doesn't work is if one of the cards uses DMA under its own
initiative (e.g. another CPU on the card doing DMA whenever it feels
like it), or if one of the cards wants to use DMA to do transfers in the
background while the main CPU gets on with something else. An example of
the latter would be a serial interface card using DMA to transfer each
transmit or receive byte, without having to interrupt the main CPU
(until the end of a transfer sequence).

If you had two of the "background DMA" cards, or one "background DMA"
and one "block DMA" card, their DMA cycles can clash, unless they obey
the DMA priority chain, and either are in adjacent slots, or all
intervening slots are occupied by cards which pass the DMA IN pin to the
DMA OUT pin.

Even then, the "background DMA" cards can't safely be used in a IIgs
(unless it is the sole card doing DMA), because of bank switching and
the global DMA BANK register. Multiple "block DMA" cards are fine,
because their driver can set the DMA BANK register before initiating the
transfer.

If you have a Carte Blanche doing "background DMA", then it is likely to
cause data corruption if it tries to do a DMA cycle while the HS SCSI
card is doing a data transfer.

-- 
David Empson
dempson@actrix.gen.nz