Getting Started
Introduction

EMS Magic is an expanded memory (EMS) emulator that installs as a removable TSR and runs under DOS and Windows 9x/NTx, including XP and Vista. It provides a complete implementation of the Lotus-Intel-Microsoft (LIM) 4.0 EMS specification, including a contiguous 64K page frame. EMS Magic can also extend the NTVDM extended memory manager (XMM) to support XMS 3.0 functions.

Unlike EMM386 and NTVDM's EMM, EMS Magic will create the page frame wherever there is room, including lower memory if necessary. This allows it to provide EMS on systems where other expanded memory managers fail. EMS Magic is also the only solution which can provide EMS on Windows Vista, due to Microsoft removing all native EMS support.

Why Is It Needed?

In order to cut costs, newer motherboards feature a lot of integrated devices. (LAN, RAID, SATA, etc.) The ROM for these devices is located in the upper memory area (UMA), where the EMS page frame typically resides. When EMM386 or the NTVDM EMM installs, it looks for a contiguous 64K block of free space in the UMA for a page frame. If there is no room in the UMA for a page frame, the EMM will not install and you have no EMS.

EMS Magic also tries to create a page frame in the UMA, but if there is no space, it will create the page frame in conventional memory. This ensures that all systems will have EMS support, at the possible expense of 64K conventional memory.

EMS Magic also allows you to place the page frame manually. For example, if you know you have space in the UMA for a page frame, but EMM386 or the NTVDM EMM will not install, you can force EMS Magic to install with a page frame at a set location in the UMA. (There must be RAM or unused UMBs at this location.)

The other use for EMS Magic is on Windows Vista systems. Although the 32-bit versions of Windows Vista can run DOS programs, there is no support for EMS regardless of the computer's hardware and memory configuration. In this case, EMS Magic is the only solution for providing EMS for DOS programs.

How It Works

EMS Magic emulates EMS completely in software using extended memory (XMS). Unlike EMM386, EMS Magic does not use Virtual 8086 (V86) mode to enable hardware paging. Instead, data is copied to and from the page frame with XMS moves. Because hardware paging is not used, the page frame does not have to be aligned on a 4K/16K page boundary. Furthermore, because EMS Magic itself operates entirely in real mode, it does not cause problems when the CPU is already running in V86 or protected mode, as is the case with Windows.

Limitations

EMS Magic cannot support data aliasing due to the pure software approach. According to the LIM EMS 4.0 specification, programs must check for hardware support before using data aliasing. In practice, however, this is not always the case. Fortunately, an intelligent page mapping algorithm is used which eliminates most inconsistencies caused by data aliasing.

Another limitation caused by the software approach is that software page mapping is significantly slower than hardware page mapping. When running a very mapping-intensive program, such as Impulse Tracker playing a 32-channel module, on a relatively slow CPU (200 MHz or less), slowdown may be experienced. However, all modern CPUs (1 GHz+) should have no problem keeping up with even the most demanding DOS applications.

XMS Fix

Besides providing EMS emulation, EMS Magic can also patch XMS 2.0 managers at runtime to support XMS 3.0. The primary reason for this is that the HIMEM implementation provided by Windows NTx supports XMS 2.0 only. Some DOS programs check for XMS 3.0, even though they use less than 64 MB XMS. In this case, XMS 2.0 calls are sufficient. EMS Magic translates XMS 3.0 calls to XMS 2.0 calls, enabling these programs to run.

EMS Magic also patches a bug found in Windows NTx, where the amount of free XMS can be incorrectly reported as more than 16/32 MB when only 16/32 MB is actually free. (Windows XP supports 32 MB XMS; all other NTx supports 16 MB XMS only.)

What's Changed?

The following has been changed in Version 2.1:

  • TSR loader format changed from COM to EXE. More compatible with TameDOS; NTVDM no longer crashes if Tame is loaded before EMS Magic.

The following has been changed or added in Version 2.0:

  • Licensing has changed; EMS Magic is now free of charge for personal, non-commercial use only. The free personal version of EMS Magic is identical to the commercial versions, with the exception of the /QUIET switch, which has been removed to discourage unauthorized use.
     
  • TSR loader improved to optimize resident memory usage and allocation. EMS emulator now uses up to 15% less memory because the XMS fix is only loaded into memory when required. Previously the XMS fix was always resident even when not activated (/NOXMS). In addition several EMS emulator functions have been optimized.
     
  • XMS fix now fully supports odd-length XMS moves when using Function 0Bh (Move Extended Memory Block), including single-byte moves. Most XMS 3.0 managers allow odd move lengths, even though the official specification says the length must be even. A few programs (specifically, "Troopers") take advantage of this and use odd lengths when moving blocks.
     
  • /NOXMS switch removed; XMS fix is no longer loaded by default. Use the /XMS3 switch to load the XMS fix if desired.
     
  • Shortcuts for command prompt with maximum EMS are now created by Windows installer. Shortcuts with VDMSound will will only be created if VDMSound is already installed.
     
  • New website launched. HTML user's manual and Windows installer updated with new logo and colors.

The following features have been added in Version 1.1:

  • EMS Magic will now load itself into UMBs by default, unless the /L switch is specified. This should save ~7K conventional memory on most systems with limited free UMBs. Previously LOADHIGH was needed to load EMS Magic into UMBs, which required 64K+ free initially.
     
  • MAX option added to the /RAM switch. Specifying /RAM=MAX will use all available XMS for EMS.
     
  • /BEST switch added. This forces EMS Magic to use the "best fit" memory allocation strategy when loading, rather than the default "last fit". This is needed for some programs that expect the upper end of conventional memory to be available.

Next >>