delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/29/01:45:13

From: "Charles Sandmann" <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DPMI problem
Date: Fri, 29 Jun 2001 0:23:33
Organization: Aspen Technology, Inc.
Lines: 34
Message-ID: <3b3bca85.sandmann@clio.rice.edu>
References: <bwS_6.65731$_T2 DOT 17269145 AT typhoon DOT tampabay DOT rr DOT com>
NNTP-Posting-Host: dcloan.hou.aspentech.com
X-Trace: selma.aspentech.com 993792504 9631 10.32.115.107 (29 Jun 2001 05:28:24 GMT)
X-Complaints-To: postmaster AT aspentech DOT com
NNTP-Posting-Date: 29 Jun 2001 05:28:24 GMT
X-NewsEditor: ED-1.5.8
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> I have a game which accesses VGA memory (A000:0000) directly. In 16-bit
> mode, that's ok, but to get it to run under DJGPP I either have to rewrite
> the thing or map VGA memory to linear memory. There is a function to do
> that, but I can only do it with a DPMI 1.0 server.

If you only plan to run under DOS, and use CWSDPMI, this feature is 
available.  But I don't recommend using it because of the portability
reasons.

> Is there a way to accomplish the same thing (i.e. direct linear access to
> A000:0000 from my ds selector) with a DPMI 0.9 server? Right now I'm looking
> at the following options, and neither of them look good:
> 
> 1. Use __djgpp_nearptr_enable(). The documentation recommends against this,
> and considering that I just overhauled a number of asm files and am aware of
> a number of bugs already, I'm not so sure I like the thought of being able
> to kill my system.

Just try it.  You probably won't kill the system - that's the worse case.
If worried you could do another method first, then fall back to near pointers
which are portable to everything except Windows NT type platforms.

> 2. Use function 02h to map the segment to a descriptor, use function 06h to
> locate the linear base of the descriptor, then use functions 07h and 08h to
> modify my ds segment so I can read that linear address.

No, use sys/farptr.h instead.  Best solution.  Check the FAQ.

> Is there any way to do it directly, or is there a DPMI 0.9 server which
> supports function 0508h (map device -> linear)?

CWSDPMI (if DOS only).  dosmemget/dosmemput functions in the library. 
near pointers.  far pointers.  4 different ways, which ever you are most
comfortable.  Have fun.

- Raw text -


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