www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/30/00:47:43

From: "Charles Sandmann" <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DPMI problem
Date: Fri, 29 Jun 2001 23:28:33
Organization: Aspen Technology, Inc.
Lines: 21
Message-ID: <3b3d0f21.sandmann@clio.rice.edu>
References: <gbb%6.63461$WB1 DOT 18246828 AT typhoon DOT tampabay DOT rr DOT com>
NNTP-Posting-Host: dcloan.hou.aspentech.com
X-Trace: selma.aspentech.com 993875785 19609 10.32.115.107 (30 Jun 2001 04:36:25 GMT)
X-Complaints-To: postmaster AT aspentech DOT com
NNTP-Posting-Date: 30 Jun 2001 04:36:25 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

> As for cwsdpmi, prior to my original post I attempted mapping A000:0000
> through the following code (My code actually checks return values, but I
> figured it was best to keep the post shorter):
> __dpmi_meminfo info;
> info.address = 0;
> info.size = (320 * 200);
> __dpmi_allocate_linear_memory(&info);
> __dpmi_map_conventional_memory_in_memory_block(&info, 0xA0000);
> 
> The first call failed with error code 1284 (504h). I looked in the DPMI spec
> for function ax=504h and this is not listed as an error code. The DPMI
> server doesn't set an error code, but it sets the carry flag indicating an
> error. I made absolutely sure of this by attempting the same call using
> int386.
> I don't see what I'm doing wrong, if this is supposed to work?

First, don't use the allocate_linear_memory call.  It's not supported.  I
would suggest malloc'ing a buffer (add an extra 4095 bytes), align it to
be 4K aligned with a mask, add __djgpp_base_address to correct for the
selector base.  Then pass this address and truncated size to the 
map conventional memory call.  I don't have an example handy.

- Raw text -


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