The DJGPP environment, utilizing GCC
|Stable release||2.0.3p2 / June 10, 2002|
|Operating system||DOS and Windows|
DJGPP (DJ's GNU Programming Platform) is a development suite for 386-based IBM PC compatibles which supports DOS-compatible 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, Gawk, sed, and ld to DPMI. Languages available include C, C++, Objective-C/C++, Ada, Fortran, and Pascal.
The compiler generates 32-bit code, which runs natively in 32-bit protected mode while switching back to 16-bit DOS calls for basic OS support. However, unlike Open Watcom, it is not a zero-based flat model due to preferring NULL pointer protection for better stability. It is currently based upon a variant of the COFF format. It can access up to 4 GB of RAM in pure DOS when using a suitable DPMI host (e.g. CWSDPMI r7 or HDPMI32).
DJGPP presents the programmer an interface which is compatible with the ANSI C and C99 standards, unofficial DOS standards, and an older POSIX Unix standard. Compiled binaries are long file name-aware and handle such filenames under Win32 by default. TSRs to support LFNs under plain DOS or Windows NT 4 are available.
While DJGPP runs in 32-bit protected mode, its stub and library heavily rely upon many 16-bit DOS and BIOS calls. Because the x86-64 versions of Windows lack support for 16-bit programs, there is no NTVDM, and DJGPP applications cannot be run. Under x86-64 systems these applications function only through emulation (e.g. DOSBox), virtualization (e.g. VirtualBox), or similar (e.g. Linux's DOSEMU). This problem arises because in long mode x86-64 processors do not support the virtual 8086 mode used to run 16-bit code in IA-32 processors. Newer x86 CPUs with VT-X do support paged real mode and unrestricted guest mode execution.
The original Quake for DOS was compiled with DJGPP, as well as other programs such as GNU Emacs, p7zip, Vim, beye, UPX, NASM, THE, Linley's Dungeon Crawl, NetHack, Perl, Python, and auxiliary applications within Arachne.