Mail Archives: djgpp/1998/05/20/21:55:33
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 <sys/farptr.h> 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
- Raw text -