www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/03/13/06:19:52

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
To: DJGPP AT SUN DOT SOE DOT CLARKSON DOT EDU
Date: Mon, 13 Mar 1995 09:30:14 GMT
Subject: Running djgpp programs under Windows?

  At the moment, it seems that programs compiled by djgpp can run in (DOS
called from within Windows) but not directly from Windows.
  It seems to me that Gnu C's paged store access system works thus (please
correct me if I am wrong):-
  All store references are caught by a set of `Gnu C Store Access Interrupt
Routines' (hereinafter GCSAIR's) (currently in GO32), which translate the
store reference into the actual address. If so, what would need to be done to
make a Gnu C compiled (*.EXE) program run in real mode without paging?:
  (a) disable the GCSAIR's, so all store access instructions work directly;
  (b) start the runtime stack somewhere else (say at the top end of whatever
store real mode can legally access);
  (c) what else?
  This also seems to relate to running under Windows, as I was once told that
"Windows can't call djgpp programs directly, as djgpp and Windows use the same
paging system" or something like that: please correct me if I am wrong. If
djgpp could compile into plain real mode, then perhaps such programs could be
called directly from Windows.
  What must a real mode program not do if it is to run under Windows?
  If (c) hereinabove does not amount to too many complications, it would be
useful if djgpp could optionally compile into real mode, as the next stage of
developing after the new GO32-less djgpp has been got working. In detail, it
could have these 3 compilation options:-
  (1) Compile into djgpp's paged mode, as now.
  (2) Compile into real mode without linking or calling the GCSAIR's. This
mode could run directly under Windows and call all the Windows facilities, and
Windows does paging for it if it running directly under Windows.
  (3) Compile so that the GCSAIR's are linked but not called. Then the program
can detect if it is running under Windows. If it is, it stays in real mode and
can call all the Windows facilities, and Windows does the paging for it. Else
the user can call a special routine `gcc_restart_paged()' which clears out all
the runtime stack etc and restarts the program in djgpp's paged mode.

- Raw text -


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