PMODE
Encyclopedia
PMODE is a DOS extender
used in several IBM PC compatible
DOS
applications in the mid and late 1990s. It was created by Thomas "Tran" Pytel
, and the first version became publicly available in 1994. The original PMODE was written to be used with programs written in x86 assembler
, specifically using Borland
's TASM
. It was later expanded for use as a drop-in replacement for DOS/4GW
under the name PMODE/W.
PMODE was released with the source code included in the distribution archive, with the only restrictions on its use being that it could not be sold for profit, nor used as the kernel of an extender to be sold for profit. Older releases also requested that the original authors be credited in the product.
The source code to PMODE/W was never made available to the public, although the extender could be used without restriction in free software, once again with a request that the authors were credited in the product. Commercial and shareware releases using PMODE/W required that a license be purchased. The cost at the time of PMODE/W v1.33's release (1996) was USD $500, although university students could purchase a license at the discounted price of USD $100.
As of 2002, PMODE/W may be freely used in commercial software, provided the software is not itself a DOS extender.
s, PMODE is used in the creation of 32-bit DOS applications that run in the protected mode
of the 386+ CPU as opposed to real mode
, which is the native execution mode of the DOS
operating system, and the only mode of operation supported by older x86 processors (e.g. the 8086). In particular, this facilitates straightforward access to memory above 1 MB (1024^2 bytes), which cannot be addressed in real mode without special hardware, such as expanded memory
boards. (In the 80286 and later processors with the A20 line
enabled, segment:offset addresses allow a maximum address of 1114095 (65535*16+65535) to be specified in real mode; this extra space above 1 MB is known as the HMA, or High Memory Area.)
A major difference between PMODE and other popular extenders is its small footprint, making it feasible to embed the whole of PMODE to the DOS-extended executable, increasing its size by approximately 10 (binary) kilobytes, and compression (see executable compression
) is supported for further reduction of the storage footprint (but not run-time memory requirement). PMODE is therefore often appropriate where size is an issue (which it usually was on old computer systems), but there is also the advantage of eliminating the external dependency on a separate(*) DOS extender (the presence of which certainly cannot be taken for granted - for instance in DOS-based "rescue disk" environments). (Most other extenders, such as DOS4G/W, require that a small real mode program (called a stub) was attached to the beginning of the protected mode executable; a stub that would locate and load the external DOS extender executable, such as DOS4GW.EXE).
PMODE implements a subset of the DOS Protected Mode Interface
(DPMI) specification version 0.9, and certain extensions that are not part of the DPMI. When a DPMI host is already loaded at the time the PMODE DOS-extended executable is run, PMODE plays a somewhat more passive role, generally passing DPMI requests through to the original provider. However, unlike some other DOS extenders, PMODE does not require the presence of a memory manager, although it is compatible with both XMS
(such as that of HIMEM.SYS) and VCPI (provided by Expanded Memory Managers, like EMM386.EXE or QEMM
), and will make use of those services if available. The DPMI compatibility allows many PMODE programs to run while Windows
is loaded, although in the Windows NT
-based series of Windows (such as XP or Vista), DOS compatibility features are not as highly developed as in the 3.x/9x
-series (including Windows Millennium).
The incomplete DPMI implementation and the lack of support for virtual memory
(demand paging
, swapping
, etc.) are reasons why PMODE may not be a suitable for some applications. PMODE was entirely written in x86 assembly language
, and early versions were not directly usable by programs written in high level languages (including C
). The price of PMODE/W may have been a deterrent to some, although most other DOS extenders at the time commanded a comparable or higher price (such as the Phar Lap DOS extender).
The role of PMODE as sample code illustrating the practical application of advanced, widely available, but under-used features documented in Intel 80386 manuals also should not be underestimated, since for many developers, this may have outweighed any significance of PMODE as a DOS-extender.
. It was developed by Charles "Daredevil" Scheffold and Thomas Pytel. Its footprint in the final executable file is slightly larger than that of the original PMODE because of the added functionality, but it is still less than 12 kilobytes according to its own documentation.
PMODE/DJ is a DOS extender derived from PMODE 3.07 by Matthias Grimrath for use with the DJGPP
compilers. PMODE/DJ can also be used with Free Pascal
.
demos
, and this was the area of application where it became extremely popular because of its performance and compactness. These features of PMODE also made it relevant for the developers of games and embedded systems.
PMODE/W is one of the four DOS extenders included in the Open Watcom compiler distribution. PMODE/W is also the default DOS extender used by TMT Pascal.
DOS extender
A DOS extender is a computer software program which enables software to run under a protected mode environment even though the host operating system is only capable of operating in real mode....
used in several IBM PC compatible
IBM PC compatible
IBM PC compatible computers are those generally similar to the original IBM PC, XT, and AT. Such computers used to be referred to as PC clones, or IBM clones since they almost exactly duplicated all the significant features of the PC architecture, facilitated by various manufacturers' ability to...
DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...
applications in the mid and late 1990s. It was created by Thomas "Tran" Pytel
Thomas Pytel
Tomasz Pytel is a Polish-American programmer, better known as Tran / Renaissance in the demoscene. He is notable for creating the Timeless demo in 1994, and for co-creating the PMODE DOS extender with Charles Scheffold . He was also the designer of the PC game Zone 66. After that, he went to 3D...
, and the first version became publicly available in 1994. The original PMODE was written to be used with programs written in x86 assembler
Assembly language
An assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices. It implements a symbolic representation of the machine codes and other constants needed to program a given CPU architecture...
, specifically using Borland
Borland
Borland Software Corporation is a software company first headquartered in Scotts Valley, California, Cupertino, California and finally Austin, Texas. It is now a Micro Focus subsidiary. It was founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn.-The 1980s:...
's TASM
Turbo Assembler
Turbo Assembler is an assembler package developed by Borland which runs on and produces code for 16- or 32-bit x86 MS-DOS or Microsoft Windows. It can be used with Borland's high-level language compilers, such as Turbo Pascal, Turbo Basic and Turbo C. The Turbo Assembler package is bundled with...
. It was later expanded for use as a drop-in replacement for DOS/4GW
DOS/4GW
DOS/4G is a 32-bit DOS extender developed by Rational Systems . It allows DOS programs to eliminate the 640 KB conventional memory limit by addressing up to 64 MB of extended memory on Intel 80386 and above machines....
under the name PMODE/W.
PMODE was released with the source code included in the distribution archive, with the only restrictions on its use being that it could not be sold for profit, nor used as the kernel of an extender to be sold for profit. Older releases also requested that the original authors be credited in the product.
The source code to PMODE/W was never made available to the public, although the extender could be used without restriction in free software, once again with a request that the authors were credited in the product. Commercial and shareware releases using PMODE/W required that a license be purchased. The cost at the time of PMODE/W v1.33's release (1996) was USD $500, although university students could purchase a license at the discounted price of USD $100.
As of 2002, PMODE/W may be freely used in commercial software, provided the software is not itself a DOS extender.
Features
Like other DOS extenderDOS extender
A DOS extender is a computer software program which enables software to run under a protected mode environment even though the host operating system is only capable of operating in real mode....
s, PMODE is used in the creation of 32-bit DOS applications that run in the protected mode
Protected mode
In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units...
of the 386+ CPU as opposed to real mode
Real mode
Real mode, also called real address mode, is an operating mode of 80286 and later x86-compatible CPUs. Real mode is characterized by a 20 bit segmented memory address space and unlimited direct software access to all memory, I/O addresses and peripheral hardware...
, which is the native execution mode of the DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...
operating system, and the only mode of operation supported by older x86 processors (e.g. the 8086). In particular, this facilitates straightforward access to memory above 1 MB (1024^2 bytes), which cannot be addressed in real mode without special hardware, such as expanded memory
Expanded memory
In DOS memory management, expanded memory is a system of bank switching introduced April 24, 1985 that provided additional memory to DOS programs beyond the limit of conventional memory. Expanded memory uses parts of the address space normally dedicated to communication with peripherals for program...
boards. (In the 80286 and later processors with the A20 line
A20 line
The A20 or addressing line 20 is one of the plethora of electrical lines that make up the system bus of an x86-based computer system. The A20 line in particular is used to transmit the 21st bit on the address bus....
enabled, segment:offset addresses allow a maximum address of 1114095 (65535*16+65535) to be specified in real mode; this extra space above 1 MB is known as the HMA, or High Memory Area.)
A major difference between PMODE and other popular extenders is its small footprint, making it feasible to embed the whole of PMODE to the DOS-extended executable, increasing its size by approximately 10 (binary) kilobytes, and compression (see executable compression
Executable compression
Executable compression is any means of compressing an executable file and combining the compressed data with decompression code into a single executable. When this compressed executable is executed, the decompression code recreates the original code from the compressed code before executing it...
) is supported for further reduction of the storage footprint (but not run-time memory requirement). PMODE is therefore often appropriate where size is an issue (which it usually was on old computer systems), but there is also the advantage of eliminating the external dependency on a separate(*) DOS extender (the presence of which certainly cannot be taken for granted - for instance in DOS-based "rescue disk" environments). (Most other extenders, such as DOS4G/W, require that a small real mode program (called a stub) was attached to the beginning of the protected mode executable; a stub that would locate and load the external DOS extender executable, such as DOS4GW.EXE).
PMODE implements a subset of the DOS Protected Mode Interface
DOS Protected Mode Interface
In computing, the DOS Protected Mode Interface is a specification introduced in 1989 which allows a DOS program to run in protected mode, giving access to many features of the processor not available in real mode...
(DPMI) specification version 0.9, and certain extensions that are not part of the DPMI. When a DPMI host is already loaded at the time the PMODE DOS-extended executable is run, PMODE plays a somewhat more passive role, generally passing DPMI requests through to the original provider. However, unlike some other DOS extenders, PMODE does not require the presence of a memory manager, although it is compatible with both XMS
XMS
XMS may mean:* eXtended Memory Specification, an application programming interface for storing data in extended memory on IBM-PC systems.* eBuddy XMS, a smartphone messaging service offered by eBuddy.* XMS, an API offered by IBM WebSphere MQ....
(such as that of HIMEM.SYS) and VCPI (provided by Expanded Memory Managers, like EMM386.EXE or QEMM
QEMM
Quarterdeck Expanded Memory Manager , was a memory manager produced by Quarterdeck Office Systems in the late 1980s through late 1990s. It was the most popular memory manager for the MS-DOS and other DOS operating systems.-QEMM product ranges:QRAM: A memory manager for 286 or higher CPU. It...
), and will make use of those services if available. The DPMI compatibility allows many PMODE programs to run while Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
is loaded, although in the Windows NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...
-based series of Windows (such as XP or Vista), DOS compatibility features are not as highly developed as in the 3.x/9x
Windows 95
Windows 95 is a consumer-oriented graphical user interface-based operating system. It was released on August 24, 1995 by Microsoft, and was a significant progression from the company's previous Windows products...
-series (including Windows Millennium).
The incomplete DPMI implementation and the lack of support for virtual memory
Virtual memory
In computing, virtual memory is a memory management technique developed for multitasking kernels. This technique virtualizes a computer architecture's various forms of computer data storage , allowing a program to be designed as though there is only one kind of memory, "virtual" memory, which...
(demand paging
Demand paging
In computer operating systems, demand paging is an application of virtual memory. In a system that uses demand paging, the operating system copies a disk page into physical memory only if an attempt is made to access it...
, swapping
Paging
In computer operating systems, paging is one of the memory-management schemes by which a computer can store and retrieve data from secondary storage for use in main memory. In the paging memory-management scheme, the operating system retrieves data from secondary storage in same-size blocks called...
, etc.) are reasons why PMODE may not be a suitable for some applications. PMODE was entirely written in x86 assembly language
X86 assembly language
x86 assembly language is a family of backward-compatible assembly languages, which provide some level of compatibility all the way back to the Intel 8008. x86 assembly languages are used to produce object code for the x86 class of processors, which includes Intel's Core series and AMD's Phenom and...
, and early versions were not directly usable by programs written in high level languages (including C
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....
). The price of PMODE/W may have been a deterrent to some, although most other DOS extenders at the time commanded a comparable or higher price (such as the Phar Lap DOS extender).
The role of PMODE as sample code illustrating the practical application of advanced, widely available, but under-used features documented in Intel 80386 manuals also should not be underestimated, since for many developers, this may have outweighed any significance of PMODE as a DOS-extender.
Derived versions
PMODE/W is a version of PMODE for the Watcom C/C++ compilersWatcom C compiler
The Watcom C/C++ compiler is a compiler for the computer programming languages C and C++ that produces executable programs for several platforms and operating systems. The code it produces for MS-DOS executes very fast. It was one of the first compilers to support the Intel 80386 "protected mode"...
. It was developed by Charles "Daredevil" Scheffold and Thomas Pytel. Its footprint in the final executable file is slightly larger than that of the original PMODE because of the added functionality, but it is still less than 12 kilobytes according to its own documentation.
PMODE/DJ is a DOS extender derived from PMODE 3.07 by Matthias Grimrath for use with the DJGPP
DJGPP
DJGPP is a development suite for 386+ IBM PC compatibles which supports DOS-enabled operating systems. It is guided by DJ Delorie, who began the project in 1989. It is a port of the popular GCC compiler, as well as mostly GNU utilities such as bash, find, tar, ls, awk, sed, and ld to DPMI...
compilers. PMODE/DJ can also be used with Free Pascal
Free Pascal
Free Pascal Compiler is a free Pascal and Object Pascal compiler.In addition to its own Object Pascal dialect, Free Pascal supports, to varying degrees, the dialects of several other compilers, including those of Turbo Pascal, Delphi, and some historical Macintosh compilers...
.
Applications using PMODE
PMODE was originally designed to be used with demosceneDemoscene
The demoscene is a computer art subculture that specializes in producing demos, which are non-interactive audio-visual presentations that run in real-time on a computer...
demos
Demo (computer programming)
A demo is a non-interactive multimedia presentation made within the computer subculture known as the demoscene. Demogroups create demos to demonstrate their abilities in programming, music, drawing, and 3D modeling...
, and this was the area of application where it became extremely popular because of its performance and compactness. These features of PMODE also made it relevant for the developers of games and embedded systems.
PMODE/W is one of the four DOS extenders included in the Open Watcom compiler distribution. PMODE/W is also the default DOS extender used by TMT Pascal.
External links
- The original distribution package of PMODE 3.07 at filegate.net
- Charles Scheffold's PMODE/W page
- PMODE/W information in TMT Pascal documentation
- DJGPP FAQ part 4 briefly lists some pros and cons of PMODE/DJ compared to CWSDPMICWSDPMICWSDPMI is a DPMI host written by Charles W Sandmann from 1996 to present, currently at r7. It is loosely based upon prior GO32 code used in DJGPP v1. It can provide DPMI 0.90+ services for programs compiled with latest versions of DJGPP etc. compilers. Since r5, it can also be used for programs...
.