From: =?ISO-8859-1?Q?Antti_Koskip=E4=E4?= Newsgroups: comp.os.msdos.djgpp Subject: Re: DMA and DJGPP Date: Sun, 19 Jan 2003 01:15:13 +0200 Organization: Helsinki Television Lines: 28 Message-ID: References: <3E298416 DOT 3A565C4C AT worldnet DOT att DOT net> NNTP-Posting-Host: cs78173152.pp.htv.fi Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: nyytiset.pp.htv.fi 1042924514 31626 62.78.173.152 (18 Jan 2003 21:15:14 GMT) X-Complaints-To: newsmaster AT pp DOT htv DOT fi NNTP-Posting-Date: 18 Jan 2003 21:15:14 GMT User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 X-Accept-Language: en-us, en In-Reply-To: <3E298416.3A565C4C@worldnet.att.net> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Paul Cousoulis wrote: > I'm building a data aquisition board that uses a PLX PCI chip to > communicate with the PCI bus. I need to set it up to use DMA to transfer > the data. I how to do I find the address and set up the memory in DJGPP > to get at the data? PCI DMA is also called bus mastering. It's way different from the old ISA DMA, which is based on the 8237 chip, and a lot more complex. The 8237 cannot be used with the PCI bus. I don't know the details, but you should get your motherboard's northbridge manuals and look there. When a PC is booted up, the BIOS assigns the card some address near the end of the address space. DJGPP FAQ has more information on how to map this area for your program. If I remember correctly, the function was __dpmi_physical_address_mapping(). You can then access this area using movedata(), or simply using a pointer to it with the "Fat DS Hack" (read the FAQ). Bus mastering means that the card is given a command to feed its data straight to the main memory, bypassing CPU, so no movedata() or pointer usage is necessary. To find out the card's physical address, just use those PCI BIOS functions to access the PCI configuration space. Remember to zero out the lowest 4 bits from the address you get. Hope this helps. -- - Antti Address is munged.