HX DOS Extender (original) (raw)

A. About HX DOS-Extender

HX DOS-Extender is a free DOS extender with built-in Win32 PE file format support. Usually the purpose of a DOS extender is to make protected-mode features available for DOS applications. HX fully supports this goal, but goes some steps further. A Win32 API emulation layer is part of HX which allows many Win32 console applications to run in DOS. This emulation goes far beyond similiar approaches in other extenders (Borland's PowerPack, WDOSX or Phar Lab TNT). Furthermore HX implements - limited - support for windows, DirectDraw, GDI and even OpenGL graphics. This allows to run "simple" Win32 GUI apps in DOS as well.

Many development environments which support creating Win32 console applications are compatible with HX, among them are:

Other tools suitable to create HX PE binaries are:

B. HX Runtime

The extender runtime includes all files needed to execute 32bit DOS extended apps. These are:

About HDPMI

HDPMI is a free DPMI server. Its features are:

About DPMILD32

DPMILD32 is a PE file loader required to load binaries into memory. It is not restricted to HX extended applications, but may also be used to load standard Win32 console apps as DPMI clients, provided that all Win32 functions called by the application are included in the emulation layer.

View dpmild32.txt for more details.

Win32 API Emulation

The Win32 API Emulation included in the HX runtime package consists of:

View compat.txt for a list of Win32 console apps successfully tested to run with the Win32 emulation.

C. HX GUI Extension

Running GUI Applications

With the HXGUI extension it is possible to run simple GUI applications with HX in DOS. "Simple" in this context means applications which use just one window as user interface. Such apps usually are based on SDL, DirectDraw and/or OpenGl. To use HXGUI a VESA V2.0 BIOS with support for linear frame buffer access (LFB) is required.

The Win32 API Emulation is enhanced by HX GUI and consists of:

Running OpenGL Applications

With the help of the Windows 9x binaries OPENGL32.DLL and GLU32.DLL is is possible to run OpenGL applications on DOS with HXGUI. However, this OpenGL implementation is pure software without hardware acceleration, so don't expect it to be too fast.


Screenshot from an OpenGL Win32 sample written by Frank Charlet, running in DOS, 256 colors.

If you don't own a copy of Windows 9x: there should be a redistributable version of OpenGL for Windows 95 available. Search for OPENGL95.EXE in the Web. Or download the plain binaries from either theMS FTP Server or here.

About SDL

SDL (Simple Directmedia Layer) is an Open Source effort to provide a multi-platform API for games, emulators, .... There are ports for various platforms available. As far as HXGUI is concerned, support for video, (wave) audio, keyboard, mouse, timer and threads is implemented. Please be aware that there is no special version of SDL for HX (or DOS) available. It is the Win32 port of SDL which can be used with HX. The SDL site is at https://www.libsdl.org/index.php, where the source code of all ports can be found.

Running QEMU with HX

QEMU is a PC emulator application available for many platforms. The Win32 ports of QEMU 0.7, 0.8 and 0.9, which are based on SDL, were successfully tested to run with HXGUI. The main advantage of QEMU running in DOS with HX is that one can try all kinds of operating systems without the need to install them on the physical HD. Here FreeDOS is booting inside a MS-DOS session:

Some notes about running QEMU under HX

Running DOSBox with HX

Another interesting SDL application is DOSBox. Running DOSBox in DOS with HX is not that senseless as it might seem at first glance. There are many old DOS games which will not run on modern machines, or they will run too fast. There are also some old games known to have caused lots of trouble even on older machines, which now run flawless in DOSBox. This is one of those:

D. HX 32-Bit Developer Support

The HXDEV developer support package contains all files required to create 32bit extended DOS apps. Two file formats are supported by the extender:

32bit DOS Applications in Win32-PE Format

This is the standard format for HX DOS extender. Since such binaries are in fact true Win32 applications, all the work to create these apps will be done by your standard development tool. For HX there isn't much left to do. So the only things included are

32bit DOS Applications in DOS-PE Format

With tool PatchPE one can change a Win32-PE file to a DOS-PE file. This may be necessary if the application uses features usually not available for Win32 applications, i.e. it calls DOS INT 21h or it directly accesses I/O ports. The tool will change just one byte, which ensures that the binary is not loaded in the Win32 subsystem when launched inside Windows.

32bit DOS Apps in MZ Format

This format is also supported by HX and consists of

E. HX 16-Bit Developer Support

Although most of HX is 32-bit, it still supports 16-bit protected-mode applications. The support consists of

F. HX Source Code

The HXSRC package contains the HX DOS extender source code. This consists of:

G. Debugging HX DOS Extended Applications

1. Debugging 32-bit DPMI Applications

2. Debugging 16-bit DPMI Applications

H. Running HX under Linux/Unix

Running HX with Emulators

Virtual PC emulators (VMWare, Qemu, Bochs, ...) should have no problem running HX. HX's DPMI server HDPMI, which must run in ring 0, has been verified to be compatible with current versions of VMWare, Qemu and Bochs. Since the 80386's hardware debugging registers usually are not supported by the emulators, debuggers that would like to use them may not always work as expected. This is true for DEB32F, DEB16F and DEB16FW.

Running HX with DosEmu (x86 Linux only)

DosEmu doesn't allow a ring 0 application like HDPMI to run under its control. That's not that bad, because DosEmu installs its own DPMI host, and most of the features required by HX are implemented. If you're running a DosEmu version < 1.3.1, you will have to upgrade (the current release version is 1.4.0).
For developers it might also be interesting that DosEmu supports using the 80386 hardware debug registers.

Some issues concerning Dosemu are

I. Roadmap

Below are the features which are currently missing in HX.

K. Support

The DosX Forumis intended as a place to ask questions concerning HX.

L. Download

Runtime GUI extension Develop. 32-bit Develop. 16-bit Source
v2.16, stable 11/16/2009 HXRT HXGUI HXDEV HXD16 HXSRC
v2.17, release candidate 05/01/2014 HXRTPassword: japheth HXGUI HXDEV HXD16 HXSRC

Important Note: HXRT217.zip has to be made password-protected, because some anti-virus programs don't like file DKRNL32.DLL (a Win32 emulation dll), which is contained in the package.

List of all versions available for download

See also:JWasm,JWlink.