From: "Charles Sandmann" Newsgroups: comp.os.msdos.djgpp Subject: Re: DMA, Pointers and Physical Memory Date: Fri, 11 May 2001 17:33:09 Organization: Aspen Technology, Inc. Lines: 18 Message-ID: <3afc2255.sandmann@clio.rice.edu> References: <989577210 DOT 22969 DOT 0 DOT nnrp-02 DOT c30b1810 AT news DOT demon DOT co DOT uk> <3995-Fri11May2001164036+0300-eliz AT is DOT elta DOT co DOT il> NNTP-Posting-Host: dcloan.hou.aspentech.com X-Trace: selma.aspentech.com 989622461 13340 10.32.115.107 (11 May 2001 23:07:41 GMT) X-Complaints-To: postmaster AT aspentech DOT com NNTP-Posting-Date: 11 May 2001 23:07:41 GMT X-NewsEditor: ED-1.5.8 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com > Anyway, you _must_ use one of the methods described by the FAQ section > 18.13 to get a physical address. I am working on providing some example code which provides an additional alternative to the methods in the FAQ. In particular, if you are running under CWSDPMI you can allocate very large buffers via malloc/sbrk, lock them into memory, and get the physical address of the buffer. The goal is a routine which you ask for a DMA buffer, and it returns a DJGPP pointer and physical address map. Since paging is enabled, the DJGPP buffer may be contiguous but the physical memory you might have "holes" in it and be forced to scatter gather or use only a portion of the buffer (especially if you have VCPI enabled). If the environment is not CWSDPMI the goal would be to transparently use the other methods as described in the FAQ. I don't have much time for testing or working on the non-CWSDPMI methods (I suspect someone has XMS buffer allocation code they could donate). If anyone wants to test or contribute drop me an email.