Previous Next Table of Contents

16. DMA Code

16.1 Current DOSEmu DMA codeUnfortunately I haven't documented this yet. However, the current code has beencompletely rewritten from this.

16.2 Original DOSEMU DMA code

    DOSEMU DMA code
    Copyright (C) 1995  Joel N. Weber II

    This dma code is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

This is intended to be a reasonably complete implementation of dma. However, the following has been omitted:

The following is known to be broken. It should be fixed. Any volunteers? :-)

This is my second real C program, and I had a lot of experience in Pascal before that.

Adding DMA devices to DOSEMU

Read include/dma.h. In the dma_ch struct, you'll find some fields that don't exist on the real DMA controller itself. Those are for you to fill in. I trust that they are self-explainatory.

One trick that you should know: if you know you're writing to a device which will fill up and you want the transfer to occur in the background, open the file with O_NONBLOCK.

References:

PC Game Programers Encyclopedia ftp://teeri.oulu.fi/pub/msdos/programming/gpe/

The Intel Microprocessors: 8086/8088, 80186, 80286, 80386, 80486, Barry B. Brey,ISBN 0-02-314250-2,1994,Macmillan

(The only reason I use this book so extensively is it's the only one like it that I can find in the Hawaii State Library System :-)


Previous Next Table of Contents