delorie.com/archives/browse.cgi | search |
Newsgroups: | comp.os.msdos.djgpp |
From: | Peter Berdeklis <peter AT atmosp DOT physics DOT utoronto DOT ca> |
Subject: | Re: DMA transfer |
Message-ID: | <Pine.SGI.3.91.971107102709.19257A-100000@atmosp.physics.utoronto.ca> |
NNTP-Posting-Host: | chinook.physics.utoronto.ca |
Sender: | news AT info DOT physics DOT utoronto DOT ca (System Administrator) |
Mime-Version: | 1.0 |
Organization: | University of Toronto - Dept. of Physics |
In-Reply-To: | <199711040117.KAA11803@asd.tnes.nec.co.jp> |
Date: | Fri, 7 Nov 1997 15:34:17 GMT |
References: | <199711040117 DOT KAA11803 AT asd DOT tnes DOT nec DOT co DOT jp> |
Lines: | 22 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
On Tue, 4 Nov 1997 satoh AT asd DOT tnes DOT nec DOT co DOT jp wrote: > I'm writing a NIC board driver using gcc compiler (DJGPP V2). > I allocate memory on PC's memory using malloc() function and > I have to set the physical address to register of the board. > ( This board performs PCI bus master device.) > But malloc() function returns virtual memory address, and I > have no idea to translate malloc'ed virtual memory address into > physical address. > > Does anyone know how to allocate DMAable large memory on PC > and translate the virtual memory address into physiacal address. You have to allocate memory below 1 MB, unless you're doing 16 bit DMA in which case 16 MB is the upper limit. To allocate memory below 1 MB call __dpmi_allocate_dos_memory. This will return the start of the real mode segment of the allocated memory, which converts easily into a physical address. --------------- Peter Berdeklis Dept. of Physics, Univ. of Toronto
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |