delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/20/21:55:33

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
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

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019