[gnu.gcc] compiling for MS-Dos

Ed@ALDERAAN.SCRC.SYMBOLICS.COM (Ed Schwalenberg) (02/09/90)

    Date: Thu, 8 Feb 90 5:41:20 CDT
    From: "David J. Camp" <david@wubios.wustl.edu>

    I know this is dredging up a forbidden subject, but I am seriously
    interested in pursuing it.  I would like to have a version of gcc that
    generates code for the 8086 processor and MS-Dos.

It's not a forbidden subject; it's just that it can't be done.

You cannot make a native GCC for the 8086 because GCC requires over
a megabyte of address space; the 8086 cannot be made to address more
than a megabyte except by kludgery, and GCC cannot be made to stomach
that kludgery.

You *can* make a GCC cross-compiler for the 8086, but it is
sufficiently hard and the rewards sufficiently meager that nobody has
done it or shows any sign of wanting to.

As I've said before in this forum, it is possible to make GCC run on
80386 machines running MS/DOS and a suitable extended-memory manager
like Phar Lap's Dos-Extender; again, it's a task with a cost-benefit
ratio that keeps it from being anyone's top priority.

    There are
    considerable economies to be accomplished by being able to develop in a
    common environment for both Unix and Dos, not to mention the ability to
    easily port many Unix packages to the Dos environment.

There are perfectly fine (but not free) C compilers available for DOS.
Having a GCC will not make porting typical Unix packages to DOS any
easier; it's typically NOT easy.

tvf@cci632.UUCP (Tom Frauenhofer) (02/09/90)

In article <19900208183405.4.ED@PEREGRINE.SCRC.Symbolics.COM> Ed@ALDERAAN.SCRC.SYMBOLICS.COM (Ed Schwalenberg) writes:
>    From: "David J. Camp" <david@wubios.wustl.edu>
>    I would like to have a version of gcc that
>    generates code for the 8086 processor and MS-Dos.
>It's not a forbidden subject; it's just that it can't be done.

As someone pointed out the last time this thread aired, why not take the
source for the Sozobon C compiler for Atari/Amiga and use it as a base
instead?  GCC would be too much work.  I have looked at Sozobon C and
porting it would be many orders of magnitude easier.  You can get Sozobon C
from any comp.sources.atari-st archives, and I think (I may be wrong) that
it's on one of the Amiga archive sites available via anonymous ftp (I forget
where).

(I've forwarded this to comp.sys.ibm.pc, I think that's a more appropriate
 place for this discussion).

Thomas V. Frauenhofer	...!rutgers!rochester!cci632!ccird7!tvf *or*
...!attctc!swamps!frau!tvf (tvf@frau, tvf@cci632)	Daffy Duck Sings:
"I once knew an acrobat's daughter who swung by her teeth from a noose. 'Til
one day her bridgework gave way, and she flew through the air like a Goose!"

rfg@ics.uci.edu (Ronald Guilmette) (02/21/90)

In article <1563@cernvax.UUCP> antoniop@cernvax.UUCP (antonio pastore) writes:
>I am interested in porting GCC on MSDOS, but for the 80386 only...
...
>2) Port the GCC under MSDOS, using either MSC or TURBO C. I started to
>compile some of the files, but it does not seem to be trivial: GCC has been
>designed to work on 32 bits cpu ('0' is often passed to mean
>NULL [= (char *)0]) and, without prototyping, I really doubt that is possible
>to port it.

Correct.  If GCC were `protoized' (or at the very least, easily "protoizable")
by individual end users (such as yourself) this would make certain porting
tasks much easier, and it would yield other benefits as well (like for
instance finding *some* bugs in GCC at compile-time).

My protoize program could help to convert GCC into an easily protoizable
form.

Basically, you would protoize all of GCC, fix up any errors you got, and
then run unprotoize on the result.  This would yield a version of
GCC which was still portable to all systems that only have an old K&R
compiler, but this new version would be trivially re-protoizable
(using protoize) by any end user who needed a fully prototyped form.

Few (if any) people (other than myself) have shown any enthusiasm for
such a conversion however.


// Ron Guilmette (rfg@ics.uci.edu)
// C++ Entomologist
// Motto:  If it sticks, force it.  If it breaks, it needed replacing anyway.