From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: DMA how? Date: Wed, 20 May 1998 20:29:23 +0100 Organization: None Message-ID: <8vu4xDAT8yY1EwIF@talula.demon.co.uk> References: <3562d0c7 DOT 0 AT news DOT uni-ulm DOT de> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 24 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Bernhard Gleich writes: > Is it possible outside DOS memory? > > How much memory is accessible? Most DMA controllers can access up to 16 meg of memory, but this isn't easy to do from a protected mode program because the linear address seen by your djgpp code are unlikely to be the same as the physical locations that are used by the DMA hardware. The usual solution is to allocate the DMA buffer from conventional memory (the low megabyte) which makes sure you will have a 1 <-> 1 mapping between physical and linear locations. You can use the __dpmi_allocate_dos_memory() routine to obtain such a buffer, and then the dosmemput() or functions to fill it with data. > Is there a good example program? It might be useful to look at the Allegro dma.c and sb.c files. -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ "Miracles are nothing if you've got the wrong intentions" - Mike Keneally