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

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Rod Pemberton" <do_not_have AT nowhere DOT cmm>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DMA and paging
Date: Mon, 24 Sep 2007 16:13:29 -0400
Organization: Aioe.org NNTP Server
Lines: 36
Message-ID: <fd95kj$sgt$1@aioe.org>
References: <46F7F665 DOT 1773 DOT 20651AE9 AT gerritvn DOT gpvno DOT co DOT za>, <fd8oq6$oju$1 AT aioe DOT org> <46F82772 DOT 52 DOT 2124586E AT gerritvn DOT gpvno DOT co DOT za>
NNTP-Posting-Host: IVw7K97ih4IohxRqyKkqFw.user.aioe.org
Mime-Version: 1.0
X-Complaints-To: abuse AT aioe DOT org
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-Priority: 3
X-MSMail-Priority: Normal
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Gerrit van Niekerk" <gerritvn AT gpvno DOT co DOT za> wrote in message
news:46F82772 DOT 52 DOT 2124586E AT gerritvn DOT gpvno DOT co DOT za...
> Have you actually done DMA programming using DJGPP and PMODEDJ ?
>

No, I've not done any DMA programming with DJGPP.  That was why I posted the
"?" - meaning I didn't have an answer to the rest of your original
questions.

> 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 ?

1) subtract base
2) if you're getting DPMI crashes, you might want to try increasing the
segment limit (0x0009FFFF or so) by one method:
   a) __dpmi_set_segment_limit(_my_ds(),0xFFFFFFFF)
   b) __djgpp_nearptr_enable()
3) you might want to try __dpmi_allocate_memory() instead of malloc()
4) if you're using CWSDPMI or CWSDPR0 instead of PMODEDJ, you'll need to
  a) call __dpmi_physical_address_mapping()
  b) be aware that 0-1Mb is already physically mapped, so you'll need to map
1Mb to xxMb.
  c) my experience with CWSDPMI v5 indicates it can't physically map more
that 128Mb
  d) IIRC, no errors were given for failures with b) and c)
  e) you might want to try CWSDPMI v6 for a larger page size, and perhaps
more physically mapped memory...
5) there is a small (64k or less) amount of memory pre-allocated below 1Mb
called a transfer buffer which you might be able to use instead of
allocating DOS memory by DPMI.  Look into __tb, __tb_segment,__tb_offset.


Rod Pemberton

- Raw text -


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