Best C++ compiler for DOS programs

S

Steve

I have to develop several large and complex C++ hardware test programs that
should work under DOS, most likely with 32-bit DOS extender. Development
workstation OS would be Microsoft XP. Quite some time ago I worked in DOS,
with Borland BC++ 4.1. I do not have it any more. Which compiler would you
recommend me now? Which ones support serious DOS program development?
Criterion should be number of available free library modules (graphic menu
system, mouse driver, I/O), ease of development, price (maybe free?),
current and future support. If compiled program can work in DOS window under
XP, at least for some early testing, that would be fine also.

So far I have found free Watcom, Digital Mars and DJGPP compilers

http://www.digitalmars.com/
http://www.openwatcom.org/index.php/Main_Page
http://www.delorie.com/djgpp/

Which one of these, or other free compilers, is best? What about commercial
compilers? Are they worth the money for DOS development? What would you
recommend me?

Steve.
 
B

benben

Which one of these, or other free compilers, is best? What about commercial
compilers? Are they worth the money for DOS development? What would you
recommend me?

Steve.

I am not sure but I think this group doesn't, and shouldn't, recommend
compilers.

You should try them all if you can, and only you knows exactly what your
criteria are.

Regards,
Ben
 
R

Rod Pemberton

I have to develop several large and complex C++
should work under DOS, most likely with 32-bit DOS extender.
workstation OS would be Microsoft XP
Which ones support serious DOS program development?
current and future support.


I've used DJGPP v2.03 and OW 1.3 for personal programs in C (not C++) for
DOS. DJGPP only supports DOS. DOS support in OW is strong (almost
Microsoft clone) but seems to be almost inactive. The main support team and
contributors seem more concerned with OS/2, WxWidgets, STL, and lately
FreeBSD and Linux, etc... DJGPP has the 'feel' of GCC and has some POSIX
support but doesn't used GLIBC. DJGPP generates better warnings than OW,
but OW compiles much faster and generates _much_ faster code. OpenWatcom as
of 1.3 (they are upto 1.5 now) has no POSIX support and IMO was a bit rough
when compared to the completeness of DJGPP. However, I've read that some of
the OW1.3 problems have supposedly been fixed, like adding long filenames
for DOS.

As for XP, I recall seeing some problems with XP for DJGPP. I don't know
whether they have been resolved or not. It's hard to get information from
Delorie on the future of or direction of DJGPP. But, it seems that he is or
was working on XP support. I tried to get him interested in using/porting
GLIBC, but he declared it to be out of the question. The next version of
DJGPP, Beta v2.04, has been Beta for 3 to 4 years...


You could also look at these DOS compilers:

DiceRTE
http://www.diefer.de/dicerte/

David Lindauer's CC386
http://members.tripod.com/~ladsoft/cc386.htm

DiceRTE hasn't released all the sources (i.e., main compiler DCC32 and his
DPMI host which he calls the "kernel") and I haven't seen any updates. Most
of the documentation is in German. CC386, a few years ago, had some errors
in the libraries. These have probably been fixed by now. It seems Lindauer
is still updating the compiler.

If you don't need DOS support, there are many other compilers for Windows:
Cygwin, Mingw, LCC-Win32, Pelles C, TenDRA(Oops, that's Linux...) If you
need support for multiple environments, OW is one of the few that support
many.


Rod Pemberton
 
V

Victor Bazarov

I'm keeping cross-posting of the message I am replying to. Not the best
practice, but I think it's appropriate here. I read it in comp.lang.c++.
I am not sure but I think this group doesn't, and shouldn't, recommend
compilers.

Not sure which group you mean, you have cross-posted your reply. And
why not recommend a compiler? I mean, I can always recommend VC++ 7.1
over VC++ 7.0, or over Turbo C++ v3, and there are reasons for that
(not for DOS, mind you, VC++ after 1.52 doesn't do DOS, IIRC). I can
recommend Intel C++ v4.5 over VC++ v6, and there are reasons for that.
There is no "best" compiler, since they are usually part of some
product, and you cannot get a bare compiler from the vendor anyway.
You should try them all if you can, and only you knows exactly what
your criteria are.

That is a sound advice, or, rather, it would be, if it were possible to
follow it. How can you "try them all", if often just to try you have to
fork over some amount of money or spend significant time fixing your code
that doesn't compile straight up? That's why opinions of those who have
tried at least two out of all existing compilers, and can compare those
two, can be very valuable.

V
 
C

Chris Hills

I have to develop several large and complex C++ hardware test programs that
should work under DOS, most likely with 32-bit DOS extender. Development
workstation OS would be Microsoft XP. Quite some time ago I worked in DOS,
with Borland BC++ 4.1. I do not have it any more. Which compiler would you
recommend me now? Which ones support serious DOS program development?
Criterion should be number of available free library modules (graphic menu
system, mouse driver, I/O), ease of development, price (maybe free?),
current and future support. If compiled program can work in DOS window under
XP, at least for some early testing, that would be fine also.

So far I have found free Watcom, Digital Mars and DJGPP compilers

http://www.digitalmars.com/
http://www.openwatcom.org/index.php/Main_Page
http://www.delorie.com/djgpp/

Which one of these, or other free compilers, is best? What about commercial
compilers? Are they worth the money for DOS development? What would you
recommend me?

Steve.

AFAIK the Borland compilers may now be downloaded FREE and freely. I
would start at the Borland web site. I have a copy of BC++ V4.1
 
F

Florian Xaver

Which ones support serious DOS program development?
I would use DJGPP. It is free, you have good support, most bug free and
there are many libraries for it...

bye,

Flo
 
S

Sjouke Burry

Rafał Maj Raf256 said:
Steve wrote:




I used DJGPP (with IDE - RHIDE afair), it was nice.
Watford compiler,now free, has worked well for me.
For 16 as well as 32 bit under DOS.
 
P

Pavel

Steve said:
I have to develop several large and complex C++ hardware test programs that
should work under DOS, most likely with 32-bit DOS extender. Development
workstation OS would be Microsoft XP. Quite some time ago I worked in DOS,
with Borland BC++ 4.1. I do not have it any more. Which compiler would you
recommend me now? Which ones support serious DOS program development?
Criterion should be number of available free library modules (graphic menu
system, mouse driver, I/O), ease of development, price (maybe free?),
current and future support. If compiled program can work in DOS window
under
XP, at least for some early testing, that would be fine also.

So far I have found free Watcom, Digital Mars and DJGPP compilers

http://www.digitalmars.com/
http://www.openwatcom.org/index.php/Main_Page
http://www.delorie.com/djgpp/

Which one of these, or other free compilers, is best? What about commercial
compilers? Are they worth the money for DOS development? What would you
recommend me?

Steve.
10 years or so ago, I used Zortech (now it should be digital mars) and
Watcom (10, 11) for 32-bit DOS development. WATCOM, at the time, was my
platform of choice for 32-bit DOS (more extenders, more powerful
although enigmatic, IDE and compiler options, better C optimization (not
C++ though)). 2 catches:
1. it was not very close to standard C++, not sure if it is now.
2. It came with a choice of 2 or 3 commercial (as the compiler itself)
"Dos Extenders" included. I am not sure they are included with the
openwatcom for free -- you have to check it out yourself. Same comments
for Zortech (Symantec - digital mars).

The only other one I knew that was widely used in production, was
Metaware's Hich C. Never used myself and do not know if it is still around.

Hope this will help,
Pavel
 
S

Steve

Thank you all for your answers.

It seems I should take a look at Watcom compiler first. They have many
target platforms and still seem very active. I assume that no latest
Microsoft or Borland C++ compilers support DOS program development. Now I
need to find some good graphical (not textual) windowing menu system library
that would, hopefully, work with Watcom. If you have some suggestion about
it, please, I would like to hear it.

Still, it was frustrating. I don't understand almost complete abandonment of
DOS program development in commercial compiler world. DOS is still, and will
be for the long time, the only platform for all programs that must have
exclusive access to hardware, or that must work alone for other reasons.
Real time applications and accurate timing is only possible in DOS. It is
ideal for hardware testing, as the controller platform, or PC hardware
malfunction detection, analysis and repair. If any important PC component is
malfunctioning, you better not try to boot other operating system because
hard disk data integrity may be compromised. Again, you must boot DOS and
run some hardware analysis program. But it is becoming harder and harder to
write programs for DOS!

Anyway, are you aware of some specialized news conference or blogs devoted
to writing various PC hardware test programs?

Steve.
 
R

Rod Pemberton

Steve said:
Thank you all for your answers.

. Now I
need to find some good graphical (not textual) windowing menu system library
that would, hopefully, work with Watcom. If you have some suggestion about
it, please, I would like to hear it.

The DJGPP crowd prefers Allegro, but I've had many problems getting Allegro
applications to work with the video cards I've used. The one I've been
looking at using is DEPUI 3.0. It works well, but it needs a small amount
of simple DJGPP DPMI code ported to OpenWatcom. I'm able to and was
planning on porting it, but just haven't gotten to it and am not sure when I
will... DEPUI seems to work well with all the video cards of mine that have
problems with Allegro.

http://www.deleveld.dds.nl/depui30/index.htm
Still, it was frustrating. I don't understand almost complete abandonment of
DOS program development in commercial compiler world.

No 32-bit DOS.

Are you sure that you _really_ need DOS to do your hardware testing? I
would think that there are well established mechanisms for Windows and Linux
to do everything that DOS can. If the DPMI host is doing alot of switching
from PM to RM and back, results can be incorrect under DOS too... Memory
testing using physically addressed memory is about the thing that comes to
mind which should be difficult outside of DOS.


Rod Pemberton
 
W

Walter Bright

Steve said:
I have to develop several large and complex C++ hardware test programs that
should work under DOS, most likely with 32-bit DOS extender. Development
workstation OS would be Microsoft XP. Quite some time ago I worked in DOS,
with Borland BC++ 4.1. I do not have it any more. Which compiler would you
recommend me now? Which ones support serious DOS program development?
Criterion should be number of available free library modules (graphic menu
system, mouse driver, I/O), ease of development, price (maybe free?),
current and future support. If compiled program can work in DOS window under
XP, at least for some early testing, that would be fine also.

So far I have found free Watcom, Digital Mars and DJGPP compilers

http://www.digitalmars.com/
http://www.openwatcom.org/index.php/Main_Page
http://www.delorie.com/djgpp/

Which one of these, or other free compilers, is best? What about commercial
compilers? Are they worth the money for DOS development? What would you
recommend me?
I don't understand almost complete abandonment of
DOS program development in commercial compiler world.

The answer is pretty simple. Commercial product developers develop for
customers who are willing to pay for products, and that dried up for DOS
long ago. I remember the same lament around 1985 or so when people were
complaining that commercial compiler companies had abandoned CP/M, which
they abandoned for the exact same reason.

-Walter Bright
Digital Mars
 
S

Sjouke Burry

Steve said:
Thank you all for your answers.

It seems I should take a look at Watcom compiler first. They have many
target platforms and still seem very active. I assume that no latest
Microsoft or Borland C++ compilers support DOS program development. Now I
need to find some good graphical (not textual) windowing menu system
library
that would, hopefully, work with Watcom. If you have some suggestion about
it, please, I would like to hear it.
Library I am using:
ZSVGA by Zephyr Software. ... ZSVGA v1.01 (ZSVGA101.ZIP) is a 32 bit
protected mode SVGA graphics library for the Watcom & Symantec C/C++
compilers. ...
 
F

Florian Xaver

Are you sure that you _really_ need DOS to do your hardware testing? I
would think that there are well established mechanisms for Windows and Linux
to do everything that DOS can. If the DPMI host is doing alot of switching
from PM to RM and back, results can be incorrect under DOS too... Memory
testing using physically addressed memory is about the thing that comes to
mind which should be difficult outside of DOS.

Please, don't post this words on this list - it is a DOS list... ;-)

Bye
Flo
 
F

Florian Xaver

ZSVGA by Zephyr Software. ... ZSVGA v1.01 (ZSVGA101.ZIP) is a 32 bit
protected mode SVGA graphics library for the Watcom & Symantec C/C++
compilers. ...

It seems to be a commercial product - it is under development anymore?

Bye
Flo
 
S

Steve

Rod said:
The DJGPP crowd prefers Allegro, but I've had many problems getting
Allegro applications to work with the video cards I've used. The one
I've been looking at using is DEPUI 3.0. It works well, but it needs a
small amount of simple DJGPP DPMI code ported to OpenWatcom. I'm able to
and was planning on porting it, but just haven't gotten to it and am not
sure when I will... DEPUI seems to work well with all the video cards of
mine that have problems with Allegro.
http://www.deleveld.dds.nl/depui30/index.htm

It looks very good. Could you give me some info, which part DEPUI needs
fixing? If it's not too complex, maybe I will be able to do it.
No 32-bit DOS.

Are you sure that you _really_ need DOS to do your hardware testing? I
would think that there are well established mechanisms for Windows and
Linux to do everything that DOS can. If the DPMI host is doing alot of
switching from PM to RM and back, results can be incorrect under DOS
too... Memory testing using physically addressed memory is about the
thing that comes to mind which should be difficult outside of DOS.

At least context switching is predictable. In preemptive multitasking you
can never be sure when you will be interrupted, by which task, what it will
do, and for how long. One another example is corrupted hard disk. Some power
glitch or bad sector can alter or damage file system system area, or
important OS system files. OS usually can't be loaded. Or, if it can, you
will further corrupt hard disk data. First rule is that you must not write
anything to that disk. But no modern OS can be loaded without hard disk
writing. Again, we need bootable medium with some rudimentary OS, like DOS,
for various repair and backup utilities. In fact, when PC becomes unstable
for whatever unknown reason, it is better to avoid diagnostic hardware
experiments (replacing components) with booting real OS. It is quite
possible that you will have to reinstall it again.

I would rather avoid DOS extenders and protected mode but I don't think it
will be possible. Just the amount of data can be enough reason (for example
scrollable graphic diagrams), and I would like to avoid the need for
temporary hard disk storage. And in protected mode DOS I usually have
something like 128MB of memory just waiting for me :)

Steve
 
S

Steve

Walter said:
Steve wrote:

The answer is pretty simple. Commercial product developers develop for
customers who are willing to pay for products, and that dried up for DOS
long ago. I remember the same lament around 1985 or so when people were
complaining that commercial compiler companies had abandoned CP/M, which
they abandoned for the exact same reason.

OK, but they abandoned CP/M for another OS of the same kind (actually worse
one). Approximately same functionality could be found on replacemet OS. With
DOS, now, we have platform that is close to hardware. There will always be
need for that, and that is the reason why it must be kept alive. Trying to
pass though several layers of code to reach hardware, and disable parts of
OS in the process, does not seem like a good approach for
test/diagnostic/repair/low level benchmark utilities.

Steve
 
W

Walter Bright

Steve said:
OK, but they abandoned CP/M for another OS of the same kind (actually worse
one). Approximately same functionality could be found on replacemet OS.
With
DOS, now, we have platform that is close to hardware. There will always be
need for that, and that is the reason why it must be kept alive. Trying to
pass though several layers of code to reach hardware, and disable parts of
OS in the process, does not seem like a good approach for
test/diagnostic/repair/low level benchmark utilities.

You mentioned "free" four times in your request for DOS development
tools. While there are a number of free DOS development tools, many of
them very good, I can tell you for a fact that there is little interest
out there in paying for DOS development tools, and that means there
isn't going to be interest from commercial tool developers in supporting it.
 
R

Rod Pemberton

Steve said:
It looks very good. Could you give me some info, which part DEPUI needs
fixing? If it's not too complex, maybe I will be able to do it.

If you use DEGFX instead of Allegro, under the DEGFX directories there is a
DJGPP directory. There are four files. Three are small. I think, but am
not sure, that these are the only files that need ported. It appears to me
that these are mostly DPMI calls or below 1Mb memory accesses (farpeek's
etc..). It's fairly straightforward but time consuming to port these. I
also see some packed structs and use of DJGPP transfer buffer.


DJGPP packed structs would need to be rewritten:

typedef struct VESA_INFO {
unsigned char VESASignature[4] __attribute__ ((packed));
/* snipped middle of struct */
unsigned char OemData[256] __attribute__ ((packed));
} VESA_INFO;

Rewritten like so (you probably don't need the __DJGPP__ section):

#ifdef __DJGPP__
#define HANDLE_PRAGMA_PACK_PUSH_POP 1
#endif

#pragma pack(push,1)
typedef struct VESA_INFO {
unsigned char VESASignature[4];
/* snipped middle of struct */
unsigned char OemData[256];
} VESA_INFO;
#pragma pack(pop)


The DJGPP transfer buffer can be setup for PM Watcom, get_dos_mem() is
called to setup __tb, and free_dos_mem() when done:

#ifdef __WATCOMC__
#ifdef __386__
void *tb;
unsigned short sel; /* sel needed to free allocated memory, don't use */

/* setup tb - transfer buffer for dos calls in memory below 1Mb */
void free_dos_mem(void)
{
r.w.ax=0x0101; /* free dos memory */
r.w.dx=sel;
int386(0x31,&r,&r);
}

void get_dos_mem(void)
{
r.w.ax=0x0100; /* allocate dos memory, no __tb in Watcom */
r.w.bx=0x400; /* 04000h (16384 bytes) in paragraphs (16 bytes) */
int386(0x31,&r,&r);
sel = r.w.dx;
tb = (void *)(r.w.ax<<4);
}
#endif
#endif



Rod Pemberton
 
A

Alex Buell

You mentioned "free" four times in your request for DOS development
tools. While there are a number of free DOS development tools, many
of them very good, I can tell you for a fact that there is little
interest out there in paying for DOS development tools, and that
means there isn't going to be interest from commercial tool
developers in supporting it.

I've just been testing your Digital Mars C++ compiler and
OpenWatcom 1.4 under Windows 98, targetting MSDOS 6.22 platforms. Very,
very, nice. But I'd really like to be able to write STL code that can
run under DOS under the large memory model. Is that even do-able? One
of my STL projects only takes up 300k when compiled as a 32 bit windows
console application. OpenWatcom 1.4 barfs on most of my STL code, but I
suppose 1.5 will be much better in that respect.

Oh, and by the way, I've managed to compile 16 bit Windows programs
using just the *downloaded* Digital Mars compiler toolchain plus the
16bit DOS development package. All I did was to copy over Win16.h from
OpenWatcom 1.4 into the \h\win16 include directory and renamed it
windows.h. Mind you, I can't link at all!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top