delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/17/05:47:34

Date: Thu, 17 Feb 2000 12:04:56 +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: <Damian Y> Re: It's back, but the ...
In-Reply-To: <Pine.LNX.4.10.10002170542210.801-100000@darkstar.grendel.net>
Message-ID: <Pine.SUN.3.91.1000217120344.21421C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 17 Feb 2000, Kalum Somaratna aka Grendel wrote:

> In Watcom thanks to its split flat memory model with mapping of the 1 st
> MB of space, I was able to use the "char * screen= 0xA0000" way of writing
> code. which made porting apps very easier and also kept all the memory
> protection intact.

That's an illusion: Watcom simply works in the nearptr mode by
default.  So you have no more protection than you have with DJGPP's
``near pointers''.

Note that the nearptr hack does not disable memory protection (it
can't: memory protection is a fundamental feature of the protected
mode, it is done on the processor level, and cannot be disabled).
What nearptr does is simply enlarge your DS selector limit to cover
the entire 4-GB address space, so it makes it easier to corrupt memory
with a stray pointer.

> And when I read the DJGPP v1.0 code I found that a similar selector was
> there to enable linear access to < 1mb memory.

Not true.  What v1.x did was to remap the conventional memory to a
fixed high address, above 1MB, where you could reach it without going
through a separate selector.  But this cannot work in DPMI
environment, because the DPMI rules don't give the client any control
on where in the address space does it get memory allocated from the
host.  The chunks you get through sbrk calls can be all over the
address space, it's entirely up to the host.

> So as you can see 32-bit protected mode extended dos is better in
> DOS4GW/WATCOM than DJGPP in this case.

Then please explain to me why do Watcom programs behave much worse on
Windows than DJGPP programs.

- Raw text -


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