www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/04/01/06:27:37

Date: Sat, 1 Apr 1995 01:30:16 -0800 (PST)
From: ".ASM SoftWare Systems" <rdc AT freenet DOT vancouver DOT bc DOT ca>
Subject: [?] GCC produce Portable .binaries - Was: 286, 88, 6502 Xcompile
To: Aaron Ucko <UCKO AT vax1 DOT rockhurst DOT edu>
Cc: ah230 AT leo DOT nmc DOT edu, djgpp AT sun DOT soe DOT clarkson DOT edu

On Fri, 31 Mar 1995, Aaron Ucko wrote:
[but, he did not quote, the name!: To: ah230 AT leo DOT nmc DOT edu]
> >>	Is it possible to compile programs with gcc to execute on a 80286 
> >>or 8088 (PC AT, XT)?  I did not find any option for these in the gcc info 
[snip of remainder of this FAQ]


> GCC knows nothing about segmentation and probably never will, so its output
> is designed for a flat model; on 286s and worse, that means only 64K of
> memory is available to your program.  (i.e. it has to fit in the ``tiny
> memory model.'')  This is extremely limiting, and there are already free
> or cheap compilers which support less limited memory models, so porting
> GCC to the 286 was not considered worthwhile (particularly as it would
> most likely be unable to compile itself, and thus lack a feature which
> is practically required...).  In short, there is no 286 port, either
> existing or planned.
> 

 This raises a question for me I have not spotted the answer for ...

 Portable .binaries ???


 What would the procedure be to compile a program using gcc (djgpp's)
under MSDOS (without adding go32 to it) and permit it to operate correctly
on Solarus, BSD, etc ... - Any system that used an X86 (x > 2) .


I (obviously ?) would be prepared to link in a .library for each OS I
intended to support and to test for the OS name a the start of the program.

I would also add a table of system call redirection - I determine OS type,
and then use the call table for that OS ...

It is possible the gcc program MAY have to live in a segment ...
Hopefully it can be many megabytes in size ...



Happy ending?:

I figure if I had a 1M sized program and 200K was OS specific code (and
the other libraries also produced 200K os specific code with this 
proposed program) and I wanted to support 5 different operating systems
I could use a special -DFlag to include the redirector and enable it.

Likely the program would "map" memory differently but isn't that what 
go32 was for ? - If djgcc V2 is "all-in-one" would you be eliminating
(or making difficult) multi-OS support ?

I understand that at this moment there is not a 100 people beating on
your door for Multi-OS code - the idea has it's merits ...

Would 'emulator' support be an idea ?
Should a djgpp compiled program run on a Power-PC MSDOS emulation ?
Could a library be developed that minimized difficult to support (by
emulation) x86 instructions 
- Power PC can run Windows can't it ?
- Djgpp can run under Windows can't it ?
- Can a djgpp compiled program run on Windows under the  Power PC ?


I'd have a program twice as big but it would run on any X86 OS (x > 2).


I realize every feature above all smushed together would be a mess ...
Would some of it be reasonable ???

Thanks for reading so much ...

- Raw text -


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