X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com From: "Gerrit van Niekerk" Organization: GPvNO To: djgpp AT delorie DOT com Date: Mon, 24 Sep 2007 21:09:06 +0200 MIME-Version: 1.0 Subject: Re: DMA and paging Message-ID: <46F82772.52.2124586E@gerritvn.gpvno.co.za> In-reply-to: References: <46F7F665 DOT 1773 DOT 20651AE9 AT gerritvn DOT gpvno DOT co DOT za>, X-mailer: Pegasus Mail for Windows (4.41) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body 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 > "Gerrit van Niekerk" wrote in message > news:46F7F665 DOT 1773 DOT 20651AE9 AT gerritvn DOT gpvno DOT co DOT za... > > The DJGPP FAQ (http://www.delorie.com/djgpp/v2faq/faq18_13.html) tells > > me to use XMS when a large DMA buffer is required, do some mapping > > tricks and use farptr functions to transfer between DJGPP memory and the > > DMA memory. My understanding is that paging is to blame for this > > complexity. > > > > My question: If paging is disabled by either configuring CWSDPMI with > > CWSPARAM or using CWSDPR0, will the physical to logical address > > mapping be 1:1? Can the physical address to program the DMA unit be > > simply computed by the data segment and offset? > > will the physical to logical address mapping be 1:1? > > To get non-paging 1:1 physical addressing, you could use PMODEDJ (i.e., > PMODETSR.EXE). Run stubedit.exe to change the DPMI host from CWSDPMI.EXE to > PMODETSR.EXE. > > stubedit my_sample.exe dpmi=PMODETSR.EXE > > Or, you can change the parameters interactively. Stubedit will ask for > replacement values. Stubedit will allow you to change the application's > stack space, RM transfer buffer, base filename, argv[0], and DPMI host. > > stubedit my_sample.exe > > I've used PMODEDJ to help find DPMI programming mistakes, and for one > situation where I don't want paging. > > Rod Pemberton > Thanks, Rod. Have you actually done DMA programming using DJGPP and PMODEDJ ? Do you have any more pointers, warnings and/or gotchas if I simply malloc() a memory buffer and calculate the physical address by adding base from __dpmi_get_segment_base_address(_my_ds(),&base) to it ? -- Gerrit van Niekerk GP van Niekerk Ondernemings BK Roosstraat 211, Meyerspark, 0184, South Africa Tel: +27(12)8036501 Fax SA: 0866 413 555 Cell: +27(73)6891370 Fax Int'l: +1(206)2034139 Email: gerritvn AT gpvno DOT co DOT za Web: http://www.gpvno.co.za