delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/02/07/09:34:11

Date: Fri, 7 Feb 92 08:49:57 EST
From: DJ Delorie <dj AT ctron DOT com>
To: kroe AT sbcs DOT sunysb DOT edu
Cc: williams AT herky DOT cs DOT uiowa DOT edu, djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: windows and djgpp
Status: O

> a.out.  The data appears at offset Y in the file.  We want
> (DS base)+0x400000 == X+Y, or (DS base) == X+Y-0x400000, where it's
> likely that X+Y < 0x400000.  Can 32-bit segments wrap around the end of
> memory?  We'd also be taking advantage of Windows' lax memory
> protection.  The other problem is that Unix code assumes that data and
> stack addresses can be used interchangeably, so the SS base must be the

A note: If you're not using go32, there's no reason why you couldn't
move the data and stack areas.  The linker supports a link mode
whereby the data starts right after the text, giving you one linear
block of memory.  As for the stack pointer, the program just takes
whatever is set up when it's executed - that's up to the extender
also.  Gcc just assumes that there aren't any segment registers - sort
of like `tiny' model.

Go32 is the part that expects text at 0x4020 and data at 0x400000, not
the compiler.  If an alternate extender sets up call gates to a 16-bit
segment and allows alternate link options, it will work just fine.

DJ
dj AT ctron DOT com
Life is a banana.

- Raw text -


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