www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/19/23:45:44

From: "Charles Sandmann" <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Q : DPMI 1.0 Function 0x508
Date: Wed, 19 Apr 2000 22:46:52
Organization: Aspen Technology, Inc.
Lines: 40
Message-ID: <38fe375c.sandmann@clio.rice.edu>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000405114546 DOT 20661R-100000 AT is>
NNTP-Posting-Host: dcloan.hou.aspentech.com
X-Trace: selma.aspentech.com 956202848 20174 10.32.115.107 (20 Apr 2000 03:54:08 GMT)
X-Complaints-To: postmaster AT aspentech DOT com
NNTP-Posting-Date: 20 Apr 2000 03:54:08 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

> On Tue, 4 Apr 2000, batchex wrote:
> > I read in the FAQ section 18.7 that it is possible to map a
> > physical memory range to a program's address space. The
> > restriction to this is the physical address and the address to
> > be mapped to must be page aligned.

For the DPMI 1.0 function 0x508 (as mentioned below), which CWSDPMI supports.

> > a. How do we ensure the mapped to address is page aligned?

Eli replied:

> If you are talking about function 0508h (only supported by DPMI 1.0
> providers), then you need to allocate the memory via function 0504h,
> which always returns page-aligned addresses.  This is clearly
> explained in the DPMI 1.0 spec.

While the DPMI spec says this, both 386MAX and CWSDPMI will support a
handle allocated with the DPMI 0.9 calls since they always return 
memory page aligned.  This is how the page protection stuff works also,
since it is also page aligned.

> > c. If the physical address is a memory mapped i/o, do we need to
> > lock the mapped address?
> 
> The DPMI 1.0 spec seems to say that they are already paged in, so I
> think you don't need to lock them.

Correct - mapped memory is always locked.  

> > Almost forgot, the function I'm talking about is DPMI 1.0
> > function 0x508 or __djgpp_map_physical_memory().
> 
> And that's where you problem lies: most DPMI servers out ther don't
> support DPMI 1.0 or functions 0508h.  You might find one or two
> servers which do, but they are not the widely-used ones.

CWSDPMI and 386MAX do support this function on DPMI 0.9 handles, so for 
a DOS only environment it might be fun to play with, but won't be portable
to Win type environments.

- Raw text -


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