Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Aug 1995 18:42:02 +0200 (MET DST)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-hackers@freebsd.org
Subject:   Re: How to abort a DMA transfer ?
Message-ID:  <199508221642.SAA11728@uriah.heep.sax.de>
In-Reply-To: <199508221037.MAA15224@labinfo.iet.unipi.it> from "Luigi Rizzo" at Aug 22, 95 12:37:41 pm

next in thread | previous in thread | raw e-mail | index | archive | help
As Luigi Rizzo wrote:
> 
> > Actually, i'd immediately kill the floppy controller if i would abort
> > a transfer in progress.  The only means then would raise the reset
> > line of the FDC.
> 
> It seems to me that it is the FDC controller the one who suffers
> from incomplete operations, not the DMA controller.

Yes, but that's why i didn't even have to think about aborting the
DMA xfer.

> Got a copy of "The Undocumented PC" (Van Gilluwe). The sample code on
> pg.855 does the following:
> 
>   1) sets the mask bit for the channel; this disable servicing requests;
>   2) clears the LSB ff
>   3) writes into the mode register for the channel
>   4) programs the addr, count, etc.
>   5) clears the mask bit for the channel
...
> I have no idea what use of the TC signal is made by my scanner's
> controller, but given that I do reset & reprogram it on close, the
> above sequence looks like what I wanted.

The mode byte in his example was: ``single mode, increment, no
autoinit, read, channel 5''.

Yes, as long as `single mode' is appropriate for you, there's no need
to worry about TC.  TC is intented for continuous mode.  Well, i've
just noticed that the PC DMAC cannot even generate an interrupt when
ready...  hmm, go figure, the Z80 DMAC did it. :)

And yes, for `single mode', the masking trick will do it.  The
peripheral device will issue a DRQ signal for each transfered
byte/word, and masking would prevent the DMAC from accepting new DRQs
for this channel.  Aborting a continuous mode transfer would not be so
easy (or even impossible at all).

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508221642.SAA11728>