DOS extender
From Wikipedia, the free encyclopedia
Developed in the 1980s to cope with the memory limitations of MS-DOS and its derivatives, DOS extenders are programs which enable software to run under the protected mode environment initially introduced with the Intel 80286 processor and later expanded upon with the Intel 80386, even if the host operating system is only capable of operating in real mode.
Contents |
[edit] DOS extender operation
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 interface with the underlying API provided by MS-DOS (and compatible) operating system(s). This was necessary because many of the functions provided by DOS require 16-bit segment and offset addresses pointing to memory locations within the first 640 kilobytes of memory. Protected mode, however, uses an incompatible addressing method where the segment registers (now called selectors) are used to point to an entry in a table which describes the characteristics of the segment. The two methods of addressing are mutually exclusive, with the processor having to make costly switches to real (or V86) mode to service non-protected mode requests.
In addition to setting up the environment and loading the actual program to be executed, the DOS extender also provides (amongst other things) a translation layer that maintains buffers allocated below the 1MB real mode memory barrier. These buffers are used to transfer data between the underlying real mode operating system and the protected mode program. Since switching between real/V86 mode and protected mode is a relatively time consuming operation, the extender attempts to minimize the number of switches by duplicating the functionality of many real mode operations within its own protected mode environment. As DOS uses interrupts extensively for communication between the operating system and user level software, DOS extenders intercept many of the common hardware (e.g. the real-time clock and keyboard controller) and software (e.g. DOS itself and the mouse API) interrupts. Some extenders also handle other common interrupt functions, such as video BIOS routines.
Essentially, a DOS extender is like a miniature operating system, handling much of the functionality of the underlying operating system itself.
[edit] Limitations
The first DOS extenders took advantage of the 16-bit protected mode features introduced with the 80286 processor. In 16-bit protected mode software could access up to 16 megabytes of memory, which at the time was a huge increase over the 640K limit software had been restricted to since the PC's introduction.
The 80386 processor improved upon the 286 in several ways, one of which was to increase the size of the fields in the segment descriptor from the 286's 16-bit base address and limit, to a full 32-bit base address with a 20-bit limit. The 386 also introduced a flag in the descriptor entry to indicate the granularity of the segment limit, which could be either as bytes or 4KB pages. This had the effect of increasing the maximum memory limit to 4 gigabytes.
Not all DOS extenders are capable of accessing the full amount of memory installed in the computer, however. In order to maintain compatibility with older software, extenders must work with any pre-existing memory management software already running (such as extended memory managers like HIMEM and expanded memory managers like EMM386). When a memory manager is running, the DOS extender must cooperate with it to ensure that the extender does not attempt to use any resources already allocated by the memory manager. Any limitations of the memory management software are thus inherited by the DOS extender. For example, MS-DOS 6.22's HIMEM could only handle 64MB of memory, while EMM386 could only grant access to 32MB of expanded memory.
Some extenders also took advantage another feature in protected mode: virtual memory. Using the VMM features of the processor, the extender can theoretically provide an application with access to the entire 4GB address space by paging blocks of memory from a secondary storage device (such as a hard disk drive) in and out of physical memory. Not all extenders supported this feature, however, as it adds additional complexity to the extender (and gives the user a reason to upgrade to a "professional" version of the DOS extender).
[edit] Development history
The DOS extender was arguably invented by Phar Lap, but it was Tenberry Software, Inc.'s (formerly Rational Systems) 386 extender DOS/4GW that brought protected mode DOS programs to the masses. Included with Watcom's C, C++ and Fortran compilers for 386 class processors, it soon became a ubiquitous mainstay of PC games and applications such as id Software's 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. As a result of the development of DOS extenders, two new software interfaces were created to take care of the many potential conflicts that could arise from the varied methods of memory management that already existed, as well as provide a uniform interface for client programs.
The first of these interfaces was the Virtual Control Program Interface, but this was rapidly overshadowed by the DOS Protected Mode Interface Specification, which grew from the Windows 3.0 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.
[edit] Obsolescence
With release of Microsoft Windows 95 DOS extender popularity began to decline, with Windows providing much of the same functionality that drove people to create DOS extenders in the first place (the tight memory address space restrictions). With the release of Windows 2000 (Windows NT v5.0), Microsoft finally shed the few remaining vestiges of MS-DOS that remained in their consumer operating systems. DOS extenders, once a hot technology, became a minority product. In spite of the decline in both popularity and use of MS-DOS and compatible operating systems, a few DOS extender writers have continued development. Many modern DOS extenders have further enhanced the concept of the DOS extender by providing emulation for some of the functionality provided by Windows, enabling some console mode applications, and even some applications that use other features of Windows (such as the GUI), to run on DOS.
[edit] Notable DOS extenders
- 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
- Thomas Pytel and Charles Sheffold's PMODE and PMODE/W. The latter was for Watcom C as an alternative to DOS/4GW, and was quite popular with demoscene programmers
- Narech Koumar's DOS32 Advanced
- Wuschel's DOS eXtender (WDOSX)
- Ergo (formerly Eclipse, formerly A. I. Architects) OS/286 and OS3/86 extenders, and DPM16 and DPM32 extenders
- Microsoft Windows (DOS based versions) included both a DPMI server and DOS extender [2].
- HX DOS Extender [1] provides limited Win32 support
- X-32 DOS extender, by Doug Huffman
- Charles W. Sandmann's CWSDPMI (technically this is not a DOS extender, it is a DPMI server used to provide DPMI services to programs generated with DJ Delorie's port of the GNU Compiler Collection to 32-bit protected mode DOS, DJGPP)
- GO32, used in older (pre-v2) versions of DJ Delorie's port of the GNU Compiler Collection, and Free Pascal
[edit] Notable DOS extended applications
- Adobe Acrobat Reader 1.0 (uses an early version of DOS/4GW professional)
- AutoCAD 11 (PharLap 386)
- 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 multitasking software
- Watcom's C, C++ and Fortran compilers for the X86
- Countless DOS games from the early to mid 1990s, mostly using DOS/4GW, including:
- id Software's DOOM and its sequels, as well as Quake (built with DJGPP)
- Looking Glass Studios' System Shock,
- Parallax Software's Descent
- Crack dot com's Abuse
- Blizzard Entertainment's Warcraft: Orcs & Humans and Warcraft II: Tides of Darkness
- 3D Realms' Duke Nukem 3D
[edit] References
- ^ 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.
[edit] External links
- OpenWatcom multi-platform C, C++ and Fortran compilers
- CC386 David Lindauer's 32-bit C compiler for DOS and WIndows
- Digital Mars C compiler
- DJ Delorie's site DOS extended port of the GNU Compiler Collection and associated programs
- Tenberry Software, Inc. Makers of DOS/4G extender
- X-32 DOS extender
- Devore Software & Consulting Makers of the Causeway extender
- DOS32 Advanced (DOS32/A)
- WDOSX Wuschel's DOS eXtender
- Japhet's Site Home of the HX DOS extender
- The Free Country's list of DOS extenders