Date: Thu, 17 Feb 2000 12:04:56 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: Re: It's back, but the ... In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.