DJGPP

Last updated

DJGPP
Developer(s) DJ Delorie
Stable release
2.05 / November 3, 2015;7 years ago (2015-11-03) [1]
Repository
Operating system DOS and 32-bit Windows
Type Compiler
License GNU GPL
Website www.delorie.com/djgpp

DJ's GNU Programming Platform (DJGPP) [2] is a software development suite for Intel 80386-level and above, IBM PC compatibles which supports DOS operating systems. It is guided by DJ Delorie, who began the project in 1989. It is a port of the GNU Compiler Collection (GCC), and mostly GNU utilities such as Bash, find, tar, ls, GAWK, sed, and ld to DOS Protected Mode Interface (DPMI). Supported languages include C, C++, Objective-C/C++, Ada, Fortran, and Pascal.

Contents

Overview

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 the Open Watcom C/C++ compiler, 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).

As of August 2020, main components of DJGPP 2 include:

It is also possible to use DJGPP to cross-compile software to DOS, for example on UNIX / Linux. Both the DJGPP libraries and the programs can be compiled this way, linked and then deployed to machines with DOS or DOS emulators.

Compatibility

DJGPP presents the programmer an interface which is compatible with the ANSI C and C99 standards, DOS APIs, and an older POSIX-like environment. Compiled binaries are long filename (LFN) aware and can handle such names under most 32-bit Windows by default, but they cannot use the Win16 or Win32 APIs that graphical programs on Windows need. [3] terminate-and-stay-resident (TSR) programs 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 on many 16-bit DOS and BIOS calls. Because the x86-64 versions of Windows lack support for 16-bit programs, [4] [5] there is no NTVDM, and DJGPP applications cannot be run. Under x86-64 systems these applications function only through emulation (e.g. DOSBox), x86 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.

See also

Related Research Articles

<span class="mw-page-title-main">Cygwin</span> Unix subsystem for Windows machines

Cygwin is a Unix-like environment and command-line interface for Microsoft Windows. Cygwin's purpose is expressed in its motto: "Get that Linux feeling – on Windows".

IA-32 is the 32-bit version of the x86 instruction set architecture, designed by Intel and first implemented in the 80386 microprocessor in 1985. IA-32 is the first incarnation of x86 that supports 32-bit computing; as a result, the "IA-32" term may be used as a metonym to refer to all x86 versions that support 32-bit computing.

Real mode, also called real address mode, is an operating mode of all x86-compatible CPUs. The mode gets its name from the fact that addresses in real mode always correspond to real locations in memory. Real mode is characterized by a 20-bit segmented memory address space and unlimited direct software access to all addressable memory, I/O addresses and peripheral hardware. Real mode provides no support for memory protection, multitasking, or code privilege levels.

<span class="mw-page-title-main">FreeDOS</span> Open source clone of MS-DOS

FreeDOS is a free software operating system for IBM PC compatible computers. It intends to provide a complete MS-DOS-compatible environment for running legacy software and supporting embedded systems.

In computing, protected mode, also called protected virtual address mode, is an operational mode of x86-compatible central processing units (CPUs). It allows system software to use features such as virtual memory, paging and safe multi-tasking designed to increase an operating system's control over application software.

x86-64 Type of instruction set which is a 64-bit version of the x86 instruction set

x86-64 is a 64-bit version of the x86 instruction set, first released in 1999. It introduced two new modes of operation, 64-bit mode and compatibility mode, along with a new 4-level paging mode.

A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. For example, a compiler that runs on a PC but generates code that runs on an Android smartphone is a cross compiler.

<span class="mw-page-title-main">DOSEMU</span> DOS compatibility layer for Linux

DOSEMU, stylized as dosemu, is a compatibility layer software package that enables DOS operating systems and application software to run atop Linux on x86-based PCs.

A DOS extender is a computer software program running under DOS that enables software to run in a protected mode environment even though the host operating system is only capable of operating in real mode.

<span class="mw-page-title-main">UPX</span>

UPX is a free and open source executable packer supporting a number of file formats from different operating systems.

<span class="mw-page-title-main">Watcom C/C++</span>

Watcom C/C++ is an integrated development environment (IDE) product from Watcom International Corporation for the C, C++, and Fortran programming languages. Watcom C/C++ was a commercial product until it was discontinued, then released under the Sybase Open Watcom Public License as Open Watcom C/C++. It features tools for developing and debugging code for DOS, OS/2, Windows, Linux operating systems, which are based upon x86, IA-32, x86-64 compatible processors.

<span class="mw-page-title-main">Arachne (web browser)</span> Graphical web browser for DOS and Linux

Arachne is a stable Internet suite containing a graphical web browser, email client, and dialer. Originally, Arachne was developed by Michal Polák under his xChaos label, a name he later changed into Arachne Labs. It was written in C and compiled using Borland C++ 3.1. Arachne has since been released under the GPL as Arachne GPL.

In computer security, executable-space protection marks memory regions as non-executable, such that an attempt to execute machine code in these regions will cause an exception. It makes use of hardware features such as the NX bit, or in some cases software emulation of those features. However, technologies that emulate or supply an NX bit will usually impose a measurable overhead while using a hardware-supplied NX bit imposes no measurable overhead.

In C and related programming languages, long double refers to a floating-point data type that is often more precise than double precision though the language standard only requires it to be at least as precise as double. As with C's other floating-point types, it may not necessarily map to an IEEE format.

CWSDPMI is a 32-bit DPMI host written by Charles W. Sandmann from 1996 to 2010, currently at r7. It is loosely based upon prior GO32.EXE code used in DJGPP v1. It can provide DPMI 0.90+ 32-bit services for programs compiled with latest versions of DJGPP etc. compilers. Since r5, it can also be used for programs requiring a DPMI stub in lieu of PMODE/DJ. It supports up to 4 GB, virtual memory, and hardware interrupt reflection from real mode to protected mode. Programs compiled with DJGPP v2 require a DPMI host, which is usually CWSDPMI.EXE or CWSDPR0.EXE. In case of CWSDPMI.EXE, the default paging/virtual memory file is C:\CWSDPMI.SWP. It is capable of running on a 386 in under 512 KB of RAM.

The DOS API is an API which originated with 86-DOS and is used in MS-DOS/PC DOS and other DOS-compatible operating systems. Most calls to the DOS API are invoked using software interrupt 21h. By calling INT 21h with a subfunction number in the AH processor register and other parameters in other registers, various DOS services can be invoked. These include handling keyboard input, video output, disk file access, program execution, memory allocation, and various other activities. In the late 1980s, DOS extenders along with the DOS Protected Mode Interface (DPMI) allow the programs to run in either 16-bit or 32-bit protected mode and still have access to the DOS API.

DJGCC is a C development suite for x86 PCs that runs under DOS or compatibles. It is guided by DJ Delorie, who started the project in 1989. It is a port of the popular gcc compiler.

Mingw-w64 is a free and open source software development environment to create (cross-compile) Microsoft Windows PE applications. It was forked in 2005–2010 from MinGW.

References

  1. "Announce: DJGPP V2.05 Released". Newsgroup:  comp.os.msdos.djgpp. 3 November 2015.
  2. Eli Zaretskii (Jul 1999). "The DJGPP Project" . Retrieved 20 Jul 2009.
  3. Wall, Kurt; Von Hagen, William (2004). The Definitive Guide to GCC. Apress. pp. 47–48. ISBN   9781590591093. Another popular, though aging, GCC-based development system is DJGPP, D.J.[sic] Delorie's free 32-bit development environment for DOS systems.
  4. "Guide: What is DJGPP?" . Retrieved November 22, 2015. The target hardware platform for DJGPP programs is a PC platform ... running DOS ... or a DOS-compatible operating system DJGPP programs run under Windows' "dos prompt" boxes.
  5. Microsoft (11 Oct 2007). "List of limitations in 64-Bit Windows". Archived from the original on 20 April 2010. Retrieved 20 Apr 2010. 16-bit MS-DOS and Microsoft Windows 3.x utilities will not start. If you attempt to start such a program, you receive a "Program.exe is not a valid Win32 application" error message.