delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/06/18:41:22

Date: Wed, 5 Apr 2000 11:46:07 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: Q : DPMI 1.0 Function 0x508
In-Reply-To: <335f5dbc.512a16ab@usw-ex0105-036.remarq.com>
Message-ID: <Pine.SUN.3.91.1000405114546.20661R-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv 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.

Where did you see that restriction?  I cannot find it anywhere,
neither in the FAQ nor in the DPMI spec where function 0800h is
described.

In any case, the address to which the physical memory is to be mapped
by function 0800h is up to the DPMI server, the caller has no control
on what that address might be.

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

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.

> b. How do we ensure there is enough space to map the physical
> memory range?

Since you already allocated the required memory with function 0504h,
you can now be sure that there's enough memory.  If function 0504h
returns an error indication, you know you don't have enough memory.

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

But this is all academical, see below.

> d. If using int 0x31 call, where the memory handle can be found?

It is returned by function 0504h, which you must call in advance.

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

So all the discussion above is quite academical: I never tried to use
that function, and I don't think someone else did.

- Raw text -


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