DOS extender
From Wikipedia, the free encyclopedia
Invented in the 1980s to cope with the memory limitations of MS-DOS and its derivatives, DOS extenders were programs which enabled other software to run under the protected mode environment initially introduced with the Intel 80286 processor, and later expanded on with the Intel 80386.
Contents |
Strictly speaking, a DOS extender is a program that does exactly what its name implies: it "extends" DOS so that programs running in protected mode can transparently access the API of the operating system. This was necessary because a great many of the functions provided by DOS required 16-bit segment and offset addresses pointing to memory locations within the first megabyte of memory. Protected mode, however, uses an incompatible addressing method where the segment registers (now called selectors) actually point to an entry in a table which describes the segment. The two methods of addressing are mutually exclusive.
In addition to setting up the environment and loading the actual program to be executed, the DOS extender also provided (amongst other things) a translation layer that maintained buffers allocated below the 1 MB real mode memory barrier. These buffers were used to shuffle data back and forth between the underlying real mode operating system and the protected mode program. Switching between real (or V86) mode and protected mode was a very time consuming operation, so the extender attempted to minimize the number of switches by providing as much functionality as it could from within the protected mode environment.
DOS extenders also handled interrupts generated both in hardware and software. The DOS API is in fact nothing more than a collection of software generated interrupts. Peripheral devices such as the real-time clock and keyboard controller are examples of hardware interrupt generating devices. Since the interrupt handlers of MS-DOS function in real (or v86) mode, the extenders also had to deal with them, either by simulating them from within protected mode, or passing them down to their real mode handlers. Many extenders also extended some of the other common interrupt functions, notably the video BIOS routines and mouse software interface.
In essence, a DOS extender functioned very much like a miniature operating system. It is, for the most part, compatible with the existing standards of real mode memory expansion, extended memory and expanded memory, relying on these to provide the actual memory before taking over (thus ensuring that no previously allocated memory was overwritten). A well behaved extender was capable of dealing with any existing memory expansion software.
The initial extenders for the 16-bit protected mode available on the 80286 processor allowed software to access up to 16 megabytes of memory at a time, due to the 16-bit segment length limit of descriptors. With the 80386 (and later) processor, the segment length limit was increased to 20 bits, with an additional bit in the descriptor entry to specify the granularity of the segment limit value as either bytes or 4 kilobyte pages. This allowed 32-bit extended programs access to a maximum of 4 gigabytes of memory, although in practice the available memory was usually much smaller. Some extenders could further extend the apparent amount of memory available by providing virtual memory, although this feature tended to be available only in the higher end (and hence more costly) DOS extenders.
The DOS extender was arguably invented by Phar Lap, but it was Tenberry Software, Inc's (formerly Rational Systems) DOS/4GW extender that brought protected mode DOS programs to the masses. Included with Watcom's popular C compiler under a generous license free of royalties and redistribution fees, it soon became an ubiquitous mainstay of PC games, beginning with id Software's massively successful game Doom.
While initially it was the memory hungry business applications that drove the development of DOS extenders, it would be PC games that truly brought them into the spotlight. Along with the DOS extenders themselves, two other software interfaces were created to take care of the many potential conflicts that could arise and provide a uniform interface for client programs. Initially there was the Virtual Control Program Interface, but this was rapidly overshadowed by the DOS Protected Mode Interface Specification, which grew from the Windows 3.x development. [1] They provided an API through which an extended program could interface with real mode software, allocate memory, and handle interrupt services. They also provided an easy method for the extender to set up the switch to protected mode, and allowed multiple protected mode programs to coexist peacefully.
With release of Windows_95 the popularity of DOS software began to decline, with Windows providing much of the same functionality that drove people to create DOS extenders in the first place (the ever increasing memory requirements of modern software). With the release of Windows_XP, based on the more secure and stable Windows_NT family, Microsoft finally shed the few remaining vestiges of MS-DOS from their consumer operating systems. DOS extenders, once a hot technology, became a minority product.
In spite of a lack of a "true" MS-DOS environment in modern Windows operating systems, some DOS extender technologies remain in development, with a few even going so far as to enhance the original concept of the extender by providing limited emulation of some Windows API functionality. This feature allows Windows console mode programs to run under the extended DOS environment by simulating the results of the Windows API calls with little more than a recompile for the new target environment.
- Tenberry Software, Inc.'s DOS/4G and DOS/4GW and DOS/16M
- Phar Lap's 286|DOS Extender and 386|DOS Extender
- Devore Software & Consulting's CauseWay 386 DOS extender for Watcom C & CC386
- Thomas Pytel's (aka Tran) PMODE and PMODE/W, the latter for Watcom C, this was very popular with demos authors
- Narech Koumar's DOS32 Advanced for Watcom C, Virtual Pascal & CC386
- Wuschel's DOS eXtender (WDOSX) for Watcom C, DJGPP, CC386, & Borland C 5.5 (Win32)
- Microsoft Windows (DOS based versions) included an extender of sorts (the DPMI specification was born of Windows development) [2].
- HX DOS Extender
- X-32 DOS extender, by Doug Huffman (used by Digital Mars C)
- AutoCAD 11
- Lotus 1-2-3 Release 3
- Oracle Professional
- IBM Interleaf
- Major BBS, a 1980s BBS software package that utilized the Phar Lap DOS extender.
- Quarterdeck DESQview and DESQview/X (includes QEMM, same vendor)
- Watcom's C, C++ and Fortran compilers for the x86
- Innumerable DOS games from the early to mid 1990s, including:
- id Software's DOOM and its sequels, as well as Quake
- Blizzard Entertainment's Warcraft and Warcraft 2
- 3D Realms' Duke Nukem 3D
- Crack dot com's Abuse
- ^ Duncan, Ray (1992). Extending DOS: A Programmer's Guide to Protected-Mode DOS, 2nd ed., Addison-Wesley, pp. 433-462. ISBN 0-201-56798-9.
- ^ Williams, Al (1993). DOS and Windows Protected Mode: Programming with DOS Extenders in C. Addison-Wesley, pp. 30. ISBN 0-201-63218-7.