delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/22/09:01:11

Date: Sun, 22 Nov 1998 14:46:04 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Antoine Pitrou <Quiche DOT Eaters AT mail DOT dotcom DOT fr>
cc: djgpp AT delorie DOT com
Subject: Re: paging memory problem ?
In-Reply-To: <365741AF.C64484F4@mail.dotcom.fr>
Message-ID: <Pine.SUN.3.91.981122144520.17686X-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Sat, 21 Nov 1998, Antoine Pitrou wrote:

> For example, I've got a 16384-byte array named _ram (4096-aligned),
> and I want to map the 4 pages contained in that array to another
> address named _mapped_ram, so that _mapped_ram contains in order
> page 2, 3, 1 and 0 of _ram.

You will need to access the page directories for that, and most DPMI
servers won't let you do that.  Sorry.

FWIW, I don't understand why do you even need a thing like that.  Are
you trying to write `mmap', or use memory-mapped files?

> I've tried with __dpmi_physical_mapping and __djgpp_map_physical_memory,
> but both failed.

These functions are for mapping physical memory, not for remapping
logical memory.

> - I don't give the right physical address of the area to map (_ram in
> the example above) ; I've tried to add __djgpp_base_address (which strangely
> equals to 0x10000000, are the addresses below used by CWSDPMI for
> virtual memory ? 

__djgpp_base_address is not a physical address at all!  It's a logical
address, after mapping by the CPU's memory-mapping hardware.

There's no simple way to get a physical address in a protected-mode
environment, for the same reason you cannot easily access the page
directories: that's what protected mode is all about!

- Raw text -


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