DOS Extenders (was: RS232 support for DOS on 486?)

Oleg Broytmann phd at phd.fep.ru
Fri Jun 8 15:43:31 EDT 2001


On 8 Jun 2001, Anurag Ved wrote:
>   I have a strong point to make. The ONLY purpose of the Usenet, as I
> see it, is to spread knowledge. Unfortunately, far too often too much
> is made of "off topic" thingy. If a post in it's basic theme is
> appropriate for a newsgroup (as this one is) then there is no reason
> why any replies to that post, even if seen deviating a bit from the
> main theme, should not be posted.
>
>   In particular, comp.lang.python lurkers (like me) who have followed
> this thread and are not as knowledgeable as Oleg would certainly like
> to know what he did with the DOS Extender.

   I didn't do anything with extenders - I just used they :) But no
problem, below is the long text that I sent privately.

> Oleg Broytmann <phd at phd.fep.ru> wrote in message news:<mailman.991986493.31662.python-list at python.org>...
> > On Thu, 7 Jun 2001, D-Man wrote:
> > > On Fri, Jun 08, 2001 at 12:02:28AM +0400, Oleg Broytmann wrote:
> > > | On Thu, 7 Jun 2001, D-Man wrote:
> > > | > Does Python even run under MS-DOS?
> > > |
> > > |    Under DOS Extender - no problem. I used Python 1.5.2 quite successfully!
> > >
> > > That's good to know.  What is "DOS Extender" anyways?
> >
> >    This is completely off-topic, and not of much interest to the newsgroup
> > (DOS, after all, is completely dead, as well as Python for DOS), so I am
> > going to write you private message to answer the question in more details.

DOS Extenders.

   Sad history of the subject.
   When first 8086/8088 processors appeared they can address only 1
megabyte (1024K) of memory. First PCs that were created by IBM reserved 384K
of upper memory for BIOS, videomemory, etc, so a program can address only
640K.
   80186 processor didn't add much to this.

   80286 did add, though. Intel invented special "protected" mode. In this
mode a program can acess a dozen of megabytes of memory. The problem was
compatibility. MsDOS/PcDOS didn't support the new mode. So some firms
that were producing compilers, libraries and other development tools started to
make special "wrappers" for programs to help developers to write in
protected mode.
   The problem was that after protected program finishes the processor must
be returned to "normal", non-protected mode - for MsDOS to operate
properly. It was near to be impossible, as 80286 processor had no such
provisions. The processor has only "reset" signal, after which entire
computer must be rebooted.
   Well, BIOS manufacturers invented a trick (probably, with help from
Intel). The program that wants to go from protected mode to non-protected
put some information into reserved area of lower memory. And reset the
processor. The computer starts to boot and passes control to the boot
program in BIOS. BIOS looks into that reserved area and instead of booting
returns control to MsDOS (that was already in memory)!

   Then came 80386! It was really huge leap forward. It can address much
more memory, and what is more important, it can address it in "flat mode" -
no need to address memry by 64K chucnks - you can address whatever you
want. And even more important - the processor had soft switch between
protected and non-protected modes.
   MsDOS, though, still didn't support protected mode, so developers
continued to use wrappers and special libraries. Of course, such wrappers
require help from compilers, so the firms that were producing compilers started
to bundle these wrappers and protected mode libraries with their compilers.
Soon these wrappers and libraries become like mini-operating systems.
Consortiums of developers invented few standard sets of API, most notable of which
was DPMI (DOS Protected Mode Interface ) version 0.9. Few very mature DPMI
implementations appeared, and soon they got the name (let us finally return
to our muttons) DOS Extenders!

   The best known DOS Extender was PharLap, but it had the problem that it
didn't support DPMI. Without support of proper standard it failed.
   The second best known was DOS/4G, created by Rational Systems. I asked
Google where it is now - and hurray! - it is now at http://www.tenberry.com/.
Its primary compiler was Watcom C: http://www.tenberry.com/dos4gw/. It was
very successful DOS Extender, in the end of DOS era almost every commercial
protected mode program used it.

   There was shareware Extender PMODE/W, that was 99% compatible with
DOS/4GW. It was free for non-commercial use, so I downloaded it. It had
tools to replace DOS/4GW in a protected .EXE. I used it to replace DOS/4GW
in perl.exe and python.exe that I used. It worked perfectly. I know there
were some free and commercial DOS/4GW replacement, ZRDX, for example. Its
pages are in russian, so I am not providing URL here.

   Other compilers also had free and/or commercial extenders. DJGPP (DOS
port of GCC) has one, for example. I put some additional information on
using python with extenders: http://phd.pp.ru/Software/Python/py4dos.txt.

Oleg.
----
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list