delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2007/09/24/15:09:32

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
From: "Gerrit van Niekerk" <gerritvn AT gpvno DOT co DOT za>
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: <fd8oq6$oju$1@aioe.org>
References: <46F7F665 DOT 1773 DOT 20651AE9 AT gerritvn DOT gpvno DOT co DOT za>, <fd8oq6$oju$1 AT aioe DOT org>
X-mailer: Pegasus Mail for Windows (4.41)
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

> "Gerrit van Niekerk" <gerritvn AT gpvno DOT co DOT za> 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



- Raw text -


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