Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need opinion for DOS extenders

185 views
Skip to first unread message

JJ

unread,
Aug 28, 2017, 8:21:58 AM8/28/17
to
Between those many DOS extenders such as DOS/4G, PMODE, CWSDPMI, HX-DOS,
GO32, EMX, etc., which one do you think is the best from programmer's
perspective? If possible, I mostly want to know their disadvantages because
they can be party crashers, so there'll be less to choose from.

Or is there a comprehensive article(s) that compare them and highlights
their pros and cons?

Rod Pemberton

unread,
Aug 29, 2017, 3:30:37 AM8/29/17
to
On Mon, 28 Aug 2017 19:21:31 +0700
JJ <jj4p...@vfemail.net> wrote:

> Between those many DOS extenders such as DOS/4G, PMODE, CWSDPMI,
> HX-DOS, GO32, EMX, etc., which one do you think is the best from
> programmer's perspective?

I think that depends on whether you're coding assembly or C etc. For
C or another high-level language, I'd use what comes with the compiler
as the high-level language was tested with it. E.g., for DJGPP I use
CWSDPMI and sometimes CWSDPR0 or PMODETSR (aka PMODEDJ), for OpenWatcom
I use DOS/4GW. Each of those came with the respected compilers.

> If possible, I mostly want to know their disadvantages because
> they can be party crashers, so there'll be less to choose from.

IIRC, there were a number of good ones out there, but I haven't
really used them. You might look at D3X, DOS32A, DPMIONE, CAUSEWAY,
QDPMI, HDPMI, WDOSX, etc. The list I compiled for personal use some
years ago had about 33 of them.

D3X
http://www.geocities.ws/dborca/assembly/d3x/d3x.htm

DPMIONE
http://www.sudleyplace.com/dpmione/

DOS/32A
http://dos32a.narechk.net/index_en.html

CAUSEWAY
http://www.devoresoftware.com/freesource/cwsrc.htm

WDOSX
http://tippach.business.t-online.de/wdosx/

HDPMI
(See archive of Japheth's website.)


I listed all or most of the 33 in this post in 2012:
msg-id: jopkp5$k0$1...@speranza.aioe.org
https://groups.google.com/d/msg/comp.os.msdos.programmer/JwtFFy9L-kA/HTPZEKaY3R4J

> Or is there a comprehensive article(s) that compare them and
> highlights their pros and cons?

I never found one. I compiled my own personal comparison of
available functions for about half of the DPMI hosts that were still
available at the time, probably around 2007 or so.


Rod Pemberton
--
Isn't anti-hate just hate by another name? Isn't
anti-protesting just protesting by another name?
Peace is a choice that both sides rejected.

JJ

unread,
Aug 29, 2017, 6:00:34 AM8/29/17
to
On Tue, 29 Aug 2017 03:31:47 -0400, Rod Pemberton wrote:
>
> I think that depends on whether you're coding assembly or C etc. For
> C or another high-level language, I'd use what comes with the compiler
> as the high-level language was tested with it. E.g., for DJGPP I use
> CWSDPMI and sometimes CWSDPR0 or PMODETSR (aka PMODEDJ), for OpenWatcom
> I use DOS/4GW. Each of those came with the respected compilers.

I see. Once I created a protected mode program using Turbo Pascal. I don't
use Turbo Pascal own library for e.g. memory allocation/disposal. Instead, I
create my own DPMI library which directly access the DPMI functions (i.e.
via interrupt calls using inline assembly). Would that be a problem? And
would it still be a problem when it comes to incompatible DPMI host like
you've mentioned on different thread?

> IIRC, there were a number of good ones out there, but I haven't
> really used them. You might look at D3X, DOS32A, DPMIONE, CAUSEWAY,
> QDPMI, HDPMI, WDOSX, etc. The list I compiled for personal use some
> years ago had about 33 of them.
>
> D3X
> http://www.geocities.ws/dborca/assembly/d3x/d3x.htm
>
> DPMIONE
> http://www.sudleyplace.com/dpmione/
>
> DOS/32A
> http://dos32a.narechk.net/index_en.html
>
> CAUSEWAY
> http://www.devoresoftware.com/freesource/cwsrc.htm
>
> WDOSX
> http://tippach.business.t-online.de/wdosx/
>
> HDPMI
> (See archive of Japheth's website.)
>
> I listed all or most of the 33 in this post in 2012:
> msg-id: jopkp5$k0$1...@speranza.aioe.org
> https://groups.google.com/d/msg/comp.os.msdos.programmer/JwtFFy9L-kA/HTPZEKaY3R4J

> I never found one. I compiled my own personal comparison of
> available functions for about half of the DPMI hosts that were still
> available at the time, probably around 2007 or so.

Thank you very much. I'll surely use those as reference.

Alexei A. Frounze

unread,
Aug 30, 2017, 6:22:06 AM8/30/17
to
On Monday, August 28, 2017 at 5:21:58 AM UTC-7, JJ wrote:
> Between those many DOS extenders such as DOS/4G, PMODE, CWSDPMI, HX-DOS,
> GO32, EMX, etc., which one do you think is the best from programmer's
> perspective? If possible, I mostly want to know their disadvantages because
> they can be party crashers, so there'll be less to choose from.

I'm not sure if there's the best one. They differ
in a number of ways. I can think of a few:
- how well they support newer hardware
and especially faster CPUs and larger RAMs
(there can be overflows and lock ups that never
happened in the DOS days because things
didn't work as fast as they do now and
because there rarely was more than some 16-32
MB of RAM (AFAIR, Windows 9x itself can't
handle more than 768MB of RAM))
- whether they support DPMI 0.9 or 1.0 or a mix
- whether they support 16-bit DPMI or 32-bit DPMI
or both
- whether they're only DPMI hosts or that and
DOS extenders
- how buggy they are
- whether they implement virtual memory
using disk space
- whether they have an option to run your code
in ring 3 (the most common) or ring 0
(the most dangerous because you can screw up
without being able to recover from e.g. a
double fault)
- whether they can be part of your EXE
- whether they can be loaded resident and
not be part of your EXE
- whether they provide additional functionality
(dunno, compressing the EXE or emulating some
devices or non-DPMI APIs)

I don't have a lot of experience with DPMI, but
I know that DOS/4GW works well with Watcom and
CWSDPMI works well with DJGPP. I implemented
DPMI support in my C compiler using whatever
32-bit DPMI host is present or loading CWSDPMI
on demand when none is there (what DJGPP-compiled
programs do). Seems to be working fine. I did
have to write some "extending" code for a few
DOS functions (file I/O) because CWSDPMI is not
a DOS extender, it's only a DPMI host. And I did
discover some instability when allocating and
freeing lots of memory blocks randomly and
launching child processes in a loop. But I then
changed the allocation pattern (to allocate all
heap memory at once and then manage it manually)
and the problem went away. I don't recall if
DJGPP is just lucky to not hit this or its
memory management is also somewhat special and
avoids allocation patterns that CWSDPMI can't
handle. DGJPP's make works just fine even though
it's seemingly doing the same kind of thing,
allocating memory and launching child processes.

Besides the DPMI itself it's also a question of
what you're gonna use it for and what compiler
(if any) you're going to use. One thing I hated
about DJGPP is that I needed to perform explicit
address translation to reach the video buffer
segment (0xA000 or 0xB800) and other things
outside my programs code and data. With Watcom
there's no problem just writing your pixels or
characters to 0xA0000+ or 0xB8000+. But, as I
understand it, a NULL pointer dereference in
Watcom may go unnoticed. DJGPP will catch it.
The difference is in how the two compilers'
libraries set up translation. I think Watcom
just maps the first megabyte directly, 1:1.
DJGPP has a shifted mapping (and, unless I'm
mistaken, it can change at run time).

And we should not forget about who's gonna
write the code, how qualified and determined
they are to do it right or fix the problems
as they arise.

And then again, it's 2017. Do you really need
this DOS/DPMI stuff? From the vagueness of the
question (you aren't telling us the purpose)
one may conclude that this is for a pet/fun
project. If it's so, then go have fun with
crashes and all and learn something in the
process.

Alex

Trifle Menot

unread,
Aug 30, 2017, 6:57:14 AM8/30/17
to
On Wed, 30 Aug 2017 03:22:05 -0700 (PDT), "Alexei A. Frounze"
<alexf...@gmail.com> wrote:

>And then again, it's 2017. Do you really need
>this DOS/DPMI stuff?

Yeah get up to date man! Who wants DOS when you can run bloated crashing
OS instead?


JJ

unread,
Aug 31, 2017, 11:06:01 AM8/31/17
to
On Wed, 30 Aug 2017 03:22:05 -0700 (PDT), Alexei A. Frounze wrote:
>
> I'm not sure if there's the best one. They differ
> in a number of ways. I can think of a few:
[snip]

Thank you. I'll keep those in mind.

> And we should not forget about who's gonna
> write the code, how qualified and determined
> they are to do it right or fix the problems
> as they arise.

All I can tell you is that I've been programming ever since late 80s. My
main programming language is Pascal and Assembly. I know the basics of C and
C++, but it's not my main programming language. I use it for code conversion
from C/C++ to Pascal/Assembly.

I have a few protected mode projects used for my own purposes written in
Pascal mixed with Assembly (using Borland's own DOS extender). Be it for
fun, or for serious system utility program. I'm pretty familiar with
protected mode, but not DOS extenders.

> And then again, it's 2017. Do you really need
> this DOS/DPMI stuff? From the vagueness of the
> question (you aren't telling us the purpose)
> one may conclude that this is for a pet/fun
> project. If it's so, then go have fun with
> crashes and all and learn something in the
> process.

Gee... that makes me to question myself. I mostly don't need it. Cause if
I'm not mistaken, most of its advantages is the greater reach of memory
address and having larger memory space. At least for now. I might in the
future, need it to e.g. access the whole video RAM via flat address space
without any video page switching (for performance reason), so I'd need at
least the protected mode for it.

JJ

unread,
Aug 31, 2017, 11:11:38 AM8/31/17
to
On Wed, 30 Aug 2017 10:57:21 +0000, Trifle Menot wrote:
>
> Yeah get up to date man! Who wants DOS when you can run bloated crashing
> OS instead?

LOL. I know you're just being sarcastic, but frankly I'm not really sure
which OS you're suggesting. :)

Robert Prins

unread,
Aug 31, 2017, 2:52:24 PM8/31/17
to
On 2017-08-31 15:05, JJ wrote:
> On Wed, 30 Aug 2017 03:22:05 -0700 (PDT), Alexei A. Frounze wrote:
> All I can tell you is that I've been programming ever since late 80s. My
> main programming language is Pascal and Assembly. I know the basics of C and
> C++, but it's not my main programming language. I use it for code conversion
> from C/C++ to Pascal/Assembly.
>
> I have a few protected mode projects used for my own purposes written in
> Pascal mixed with Assembly (using Borland's own DOS extender). Be it for
> fun, or for serious system utility program. I'm pretty familiar with
> protected mode, but not DOS extenders.

Why don't you use Virtual Pascal? There is a way to write extended DOS programs
with it, but don't ask me for any details, I just use the Windoze compiler to
generate the assembly listings, and use those to change most code into in-line
assembler. Works like a charm, and those routines can even call the routines in
the System (or any other) unit.

Try lift-s...@2017-08-20.rar (password: "password") on my Google drive @
<https://goo.gl/ZN3XAB> - and no, "lift.ixi", renamed from "lift.exe" does
***not*** contain a virus.

Manual for the programs can be found at
<https://prino.neocities.org/miscellaneous/pascal.html>, main ones to compile are

chkdat.pas
lift.pas
newlift.pas
h-h2rtf.pas
h-h2html.pas

Last one is used to almost completely generate all tables the above site,
starting @ <https://prino.neocities.org/log/log.html>

Robert
--
Robert AH Prins
robert(a)prino(d)org

Rod Pemberton

unread,
Sep 1, 2017, 5:27:48 AM9/1/17
to
On Thu, 31 Aug 2017 22:05:20 +0700
JJ <jj4p...@vfemail.net> wrote:

> All I can tell you is that I've been programming ever since late 80s.
> My main programming language is Pascal and Assembly.

IMO, both of those defeat your previously stated purpose:

JJ> My aim here, is to have a multi platform executable file so that the
JJ> program can be at its best in each platform / system mode.

Neither assembly nor Pascal is very portable, although Pascal is more
so than assembly.

> I know the basics of C and C++, but it's not my main programming
> language. I use it for code conversion from C/C++ to Pascal/Assembly.

C and Forth are widely available. Actual portability of C and Forth
code is a different issue.

JJ

unread,
Sep 1, 2017, 7:33:07 AM9/1/17
to
On Fri, 1 Sep 2017 05:28:59 -0400, Rod Pemberton wrote:
> On Thu, 31 Aug 2017 22:05:20 +0700
> JJ <jj4p...@vfemail.net> wrote:
>
>> All I can tell you is that I've been programming ever since late 80s.
>> My main programming language is Pascal and Assembly.
>
> IMO, both of those defeat your previously stated purpose:
>
> JJ> My aim here, is to have a multi platform executable file so that the
> JJ> program can be at its best in each platform / system mode.
>
> Neither assembly nor Pascal is very portable, although Pascal is more
> so than assembly.
>
>> I know the basics of C and C++, but it's not my main programming
>> language. I use it for code conversion from C/C++ to Pascal/Assembly.
>
> C and Forth are widely available. Actual portability of C and Forth
> code is a different issue.

I'm not sure where you are going with this. I was simply replying your
question. I don't really care which programming language (as long as I can
use it) and compiler I'll use to create the DOS and Windows portion of the
executable file, as long as each produces the optimum result for each
platform / system mode. Even if it means that I have to create two sets of
entirely different source codes (i.e. non portable source code) for each
platform / system mode. e.g. the DOS portion may use pure Assembly, while
the Windows portion may use Pascal.

rug...@gmail.com

unread,
Sep 2, 2017, 6:54:10 PM9/2/17
to
Hi,

On Thursday, August 31, 2017 at 1:52:24 PM UTC-5, Robert Prins wrote:
> On 2017-08-31 15:05, JJ wrote:
> >
> > I have a few protected mode projects used for my own purposes
> > written in Pascal mixed with Assembly (using Borland's own DOS
> > extender).
>
> Why don't you use Virtual Pascal? There is a way to write
> extended DOS programs with it, but don't ask me for any details,

VP is abandoned (2005?) but still available on Ning group
(or mirror).

I don't think the DOS32 part was officially incorporated
(done by Veit Kannegieser), so it may be hard to find.
In fact, I don't remember if I have that add-on here locally.
He used WDOSX, whose own STUBIT can probably make some .EXEs
work (rarely tested by me, though, but it did work for simple
stuff).

I do think FPC is a better choice, for many reasons (and it
also supports inline assembly), but VPC is still good. Besides
WDOSX (which munges the .EXE), you could also just use HX to
run the Win32 PE/EXE output under raw DOS.

VPC's built-in linker also supports adding a DOS stub, so you
can put both DOS .EXE (say, TP55-compiled) and Win32 version
into one file, if desired.

> I just use the Windoze compiler to generate the assembly listings,
> and use those to change most code into in-line assembler.

Speaking of HX, so far you can (only) run the FPC i8086-msdos host
cross-compiler in either Linux or Windows. But the Win32 version
can run (once installed, copied, and after editing a few settings)
under HX in raw DOS, if you need that.
0 new messages