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

Borland C++ DOS Extender

720 views
Skip to first unread message

David Castelow

unread,
Jul 29, 1997, 3:00:00 AM7/29/97
to

Can anyone advise where I could find a copy of the 32-bit DOS extender to Borland
C++ 4.52 for DOS. I understand Borland no longer sell this product. No, PharLap
will not suffice: I am afraid it must be Borland.

Dr David Castelow David.C...@gecm.com
GEC Marconi Research Centre
Elstree Way
Borehamwood
Herts
England

Dav

unread,
Aug 4, 1997, 3:00:00 AM8/4/97
to

David Castelow <David.C...@gecm.com> wrote:

>Can anyone advise where I could find a copy of the 32-bit DOS extender to Borland
>C++ 4.52 for DOS. I understand Borland no longer sell this product. No, PharLap
>will not suffice: I am afraid it must be Borland.

This was posted a while back by one David.

Dav.


Hi,
This is details for using BC45/BC50 to generate 32-bit
programs that will run in native mode MSDOS
This should also work with BC40 but I have never
had a BC40 system to verify it.

The secret is that some of the BC commandline programs were built
with the BC tools... and almost everything required to support
them (DPMI and a windows-like kernel) comes with the BC distribution.
The one thing that is missing is a short stub that gets prepended
to the executable; the purpose of this stub is to load in the
DPMI manager. But since, for example, TLINK32 is a 32-bit DOS
program... the stub is readily available by taking it off the
front end of TLINK32. So everything you need comes with the
distribution.

The first step is to get a copy of the stub program. The following
sequence of commands will get it for you:

cd bcxx\bin
copy tlink32.exe q
debug q
- rcx
: 870
- rbx
: 0
- w
- q
rename q 32stub.exe

Once you have 32stub.exe in your bin directory you don't have to
deal with it again; the linker knows where to get it and what to do
with it.

After that you just have to know some undocumented linker switches
and libraries to be on your way. The compiler also has undocumented
switches... but I don't think those will work without some other
files Borland isn't distributing. The linker switches for
a 32-bit DOS executablee are /Tpe/ax. And you need to link in the
startup file c0x32.obj and the library files cw32.lib and import32.lib.
Once you have done that, you will have a 32-bit program that will
utilize DPMI facilities to run either under plain DOS or in a DOS
window.

Here is a sample build:

bcc32 -c myprog.c
tlink32 /Tpe/ax/c c0x32.obj myprog.obj,myprog,myprog,cw32.lib import32.lib

Specify the files in the order given; it will find the 32stub.exe program
you made earlier and prepend it to the program after the link. Note that if
you only did a partial installation you may need to get some of these
files off your distribution CD.


Once you have done all this you have a 32-bit program. If you need to
play with interrupts or 16-bit callbacks the DPMI system is DPMI 1.0;
any DPMI 0.9 or 1.0 docs should be useful in this regard.

Note that at run time, this newly compiled program will look for the
two files '32rtm.exe' and 'dpmi32vm.ovl' on the path. It WILL NOT RUN
without these files. As of BC45 the licensing agreement of borland
indicated you can redistribute these latter two files if you want. But
do not hold me liable for that latter statement; it is your responsibility
to read the license statement yourself prior to redistributing any
software you bought from borland or other manufacturers.

David

---------------------------------
DavMac - Sharking!!
smc...@corryong.albury.net.au
---------------------------------


Nick Leverton

unread,
Aug 12, 1997, 3:00:00 AM8/12/97
to

In article <87067637...@proxy1.albury.net.au>
Dav...@iname.com (Dav) writes, quoting another unknown author,

> This is details for using BC45/BC50 to generate 32-bit
> programs that will run in native mode MSDOS
[snip]
> .... The linker switches for
> a 32-bit DOS executablee are /Tpe/ax. And you need to link in the
> startup file c0x32.obj and the library files cw32.lib and import32.lib.
> Once you have done that, you will have a 32-bit program that will
> utilize DPMI facilities to run either under plain DOS or in a DOS
> window.
[snip]

>Note that at run time, this newly compiled program will look for the
>two files '32rtm.exe' and 'dpmi32vm.ovl' on the path.
[snip]

There must be more to it than that. I have followed the full
instructions to the letter with just printf("hello, world"), and the
resulting program won't run under either DOS with EMM386 or under
Win3.1, both of which provide DPMI. The error given is

This program cannot be run in DOS mode.
(Load error 85)
32stub error: The program can not be loaded

Has anyone successfully followed the instructions as previously posted
(summarised above, see the References header), taken the executable and
the two named files to a naked DOS machine, and had it run ?

The program as I generate it *will* run under NT, which makes me think
that some Win32 function (as distinct from Win32S, which I have loaded
on the 3.1 machine) is still being called. It's doubly suspicious that
the above instructions call for linking with cw32.lib, which according
to the naming conventions should be the win32 standard I/O library with
Win32 console support.

I notice that the source directory on the CDROM contains sources to the
run-time libraries, and that one of the options is indeed to create
libraries for DPMI32 and DPMI16. Unfortunately this requires TASM and
TASM32, and my vintage TASM version 1.0 is not up to the job ! Before I
lash out on an upgrade to TASM, I'd be very grateful if someone could
check whether the instructions are indeed correct in practice, and if
not then perhaps generate DPMI libraries and link with them instead of
cw32, and see if it works ?

Nick Leverton


Eugene

unread,
Aug 13, 1997, 3:00:00 AM8/13/97
to

On Tue, 12 Aug 97 22:27:41 GMT, lev...@warren.demon.co.uk (Nick
Leverton) wrote:
*snip*
:Has anyone successfully followed the instructions as previously posted

:(summarised above, see the References header), taken the executable and
:the two named files to a naked DOS machine, and had it run ?
:
:The program as I generate it *will* run under NT, which makes me think
:that some Win32 function (as distinct from Win32S, which I have loaded
:on the 3.1 machine) is still being called. It's doubly suspicious that
:the above instructions call for linking with cw32.lib, which according
:to the naming conventions should be the win32 standard I/O library with
:Win32 console support.

Actually, the original poster forgot to mention that you need an
updated version of 32rtm.exe which comes w/ the now-defunct Powerpack.
However, according to the Borland license, this file can be
freely distributed along w/ a DPMI program. Just ask some1 to send
you a DPMI32 program and you can make use of the new 32rtm.exe.

Disclaimer: This is just my theory. Don't blame me if you
get legal letters flooding your mailbox.

|_______________*
(OOOOOOO0______________/
|____________ __ ______ ____ ____ __
(OOOOOOOOO0____________/ / / / / __ `/ _ \/ __ \/ _\
|____|_________ _/ /_/ / /_/ / __/ / / / __/
(OOOOOO0______________/ \__,_/\__, /\___/_/ /_/\___/
| /____/

[Usenet Posters: Remove ".spam_die" to reply]

Nick Leverton

unread,
Aug 13, 1997, 3:00:00 AM8/13/97
to

In article <33f1701f...@news.pacific.net.sg>
euge...@pacific.net.sg.spam_die (Eugene) writes:
[constructing 32-bit DMPI programs with Borland C++ 4.5]

> Actually, the original poster forgot to mention that you need an
>updated version of 32rtm.exe which comes w/ the now-defunct Powerpack.
>However, according to the Borland license, this file can be
>freely distributed along w/ a DPMI program. Just ask some1 to send
>you a DPMI32 program and you can make use of the new 32rtm.exe.

Ftpsearch is your friend. There also appears to be a corresponding
dpmi32vm.ovl to go with it. Thanks for the hint !

N. [http://ftpsearch.ntnu.no/ and mirrors ...]


0 new messages