Comment by WalterBright

6 days ago

The Digital Mars compiler for DOS is available for free.

https://www.digitalmars.com/

But the GCC, OpenWatcom, and DJGPP compilers the FreeDOS folks recommend are additionally free software, which is of real value to some of us. Zortech C had a reputation for producing better code IIRC, and it could run on an 80286, which I'm not sure the others can?

  • I don't remember when we transitioned to 32 bit DOS extenders for the DOS compilers, but we never got any pushback for that. Developers all used 386 computers.

    I remember attending a compile panel at one of the SDWest conferences. The panel members were myself, representing Zortech, along with representatives from Borland, Watcom, and Microsoft.

    The first question was "do you sell a version that will work on a floppy disk only computer?" One of the other panelists responded with yes, we do. He went on to describe how the various bits could be distributed among multiple floppies, and of course it involved a lot of shuffling floppies in and out.

    I was next. I replied, "Yes, we have a version that does it! It costs $200 extra and comes with a hard disk drive!"

    That got a huge laugh, and that was the end of that question. I never heard it again from anybody. Sometimes, it's just time to move on!

    • Historically there were 24-bit ("16 megs") DOS extenders that would work on a 286, though the 286's inability to seamlessly go back to real mode (which is needed for compatibility with BIOS routines) creates issues that make 286 protected mode a bit of a theoretical curiosity.

      1 reply →

    • That was a very intelligent answer.

      I was trying to come up with some advantage of Zortech C that might justify using it now instead of an open-source compiler like DJGPP under some circumstance. Any ideas?

      6 replies →

  • I guess it made a lot of sense to implement compilers in 32-bit protected mode to get more space to work with easier? Free Pascal's compiler also requires 32-bit even if it can generate 16-bit DOS code as well (at least when cross-compiling from some other OS; I have not tried to cross-compile from DOS 32-bit compiler to DOS 16-bit executable).

    Some people (and by that I mean Debian people; not sure about anyone else) disagree about OpenWatcom being free software. The license has some unusual requirement(s). There has been talk for a long time about possibly fixing that, but I do not know how on track that is (or how much it matters, in practice): https://github.com/open-watcom/open-watcom-v2/discussions/27...

    • I developed on a 32 bit machine because of memory protection. Memory corruption resulted in seg faults, while in 16 bit real mode memory corruption would scramble your hard disk.

      I ran all the test suites on protected machines. Only when everything was perfect did I run the programs in real mode DOS.

      Protected mode memory is the greatest advance ever in computer hardware.

      1 reply →

  • I don't know about OpenWatcom but I used the original Watcom on my old 286 just fine. Even the Windows 3.1 IDE ran fine on it IIRC.

https://www.digitalmars.com/download/freecompiler.html

Seems to require Win32 (Digital Mars C/C++ Compiler Version 8.57). Is there a version of the C compiler than can run on FreeDOS or MS-DOS ?

  • Not any more. The Win32 one functions as a cross compiler. The compiler is a little large for MS-DOS' memory.

    • AFAIU it was just (some versions of?) DOS/4GW that had a 64MB limit. Some other DOS extenders, in particular the open source DOS/32A, allow using the full 4GB virtual address space.