delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/16/02:36:02

From: "Charles Sandmann" <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Physical to Linear fails in MS-DOS
Date: Sat, 16 Oct 1999 00:00:46
Organization: Aspen Technology, Inc.
Lines: 19
Message-ID: <3807c02e.sandmann@clio.rice.edu>
References: <3807d8ac DOT 134142 AT news DOT enter DOT net>
NNTP-Posting-Host: dcloan.aco.aspentech.com
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

> Here is my current problem.  The following sample program runs fine in a
> MS-DOS box in Windows95/98 but the call to
> __dpmi_physical_address_mapping fails under MS-DOS using cwsdpmi.exe.
> Is this a DPMI problem with cwsdpmi or something I'm doing wrong?  

>   meminfo.address = segment*16;
>   if(__dpmi_physical_address_mapping(&meminfo) == -1) {

You are passing an address which is in the 1st 1Mb region.  The DPMI specs
specifically state:

" Do not use this service to access memory that is mapped in the first
  megabyte of address space (the real mode addressable region).  "

This memory is already mapped in your address space and does not need to
be mapped again.  This is a case where Windows DPMI is lenient and ignores
the DPMI requirements.  Early versions of CWSDPMI (r2 or r3 and earlier)
didn't enforce this but it was causing some problems which people had bugs
in their code.

- Raw text -


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