From owner-freebsd-hackers Tue Aug 22 09:57:15 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.FreeBSD.org (8.6.11/8.6.6) id JAA04256 for hackers-outgoing; Tue, 22 Aug 1995 09:57:15 -0700 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.FreeBSD.org (8.6.11/8.6.6) with SMTP id JAA04245 for ; Tue, 22 Aug 1995 09:56:55 -0700 Received: from sax.sax.de by irz301.inf.tu-dresden.de with SMTP (5.67b+/DEC-Ultrix/4.3) id AA18778; Tue, 22 Aug 1995 18:56:12 +0200 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id SAA07010 for freebsd-hackers@freebsd.org; Tue, 22 Aug 1995 18:56:12 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.6.11/8.6.9) id SAA11728 for freebsd-hackers@freebsd.org; Tue, 22 Aug 1995 18:42:02 +0200 From: J Wunsch Message-Id: <199508221642.SAA11728@uriah.heep.sax.de> Subject: Re: How to abort a DMA transfer ? To: freebsd-hackers@freebsd.org Date: Tue, 22 Aug 1995 18:42:02 +0200 (MET DST) Reply-To: freebsd-hackers@freebsd.org In-Reply-To: <199508221037.MAA15224@labinfo.iet.unipi.it> from "Luigi Rizzo" at Aug 22, 95 12:37:41 pm Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 1711 Sender: hackers-owner@freebsd.org Precedence: bulk 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. ;-)