
         EXMS86 - XMS 2.0 driver powered by EMS 4.0 for 16-bit systems

                           http://mateusz.fr/exms86


EXMS86 is a TSR that provides XMS 2.0 memory services using an EMS 4.0 expanded
memory source. Designed for 16-bit DOS computers equipped with EMS cards (like
the Lo-Tech EMS board, Intel AboveBoard, Bocaram XT, etc). EXMS86 enables
software requiring XMS to run on legacy systems like the IBM PC, XT, etc.


=== WHY? ===

I wanted my DOSMid MIDI player to support EMS when XMS isn’t available. Sure, I
could have added EMS support directly into DOSMid, but that would be so boring.

Instead, I decided to take a more versatile route by building a generic XMS
driver. It felt like a more rewarding challenge, and one that could benefit
other projects too. So here it is.


=== HOW IS IT POSSIBLE? ===

It is a common misconception that XMS is only possible on 386+ machines.

XMS (v2.0) is fundamentally a memory-copying API. Applications using XMS do not
care where the memory comes from. While XMS is commonly associated with RAM
located above the 1 MB boundary (often called "extended memory") on 386+ PCs,
that's a historical convention, not a technical requirement. Hence it is
perfectly possible for a driver to expose memory via the XMS API even if said
memory is not part of the system's RAM - like memory from an EMS board.


=== FEATURES ===

- Exposes EMS 4.0 pages over the XMS 2.0 API
- Optimized for classic PCs (e.g. 8088, 80186, etc) with EMS hardware
- hand-crafted assembly: minimal overhead and low resource usage


=== USAGE ===

To load EXMS86, simply execute EXMS86.COM.

If another XMS provider is already present, EXMS86 will refuse to load.
However, it can coexist with an XMM driver that supplies only UMB and/or HMA,
but not XMS memory. In this case, EXMS86 will take control of the XMS API and
relay UMB, HMA, and A20 requests to the pre-existing driver.

If you'd prefer to load EXMS86 through CONFIG.SYS, to ensure it initializes
before your UMB driver, you can use such CONFIG.SYS "INSTALL" directive:

INSTALL=C:\EXMS86\EXMS86.COM
DEVICE=C:\SOME\UMB\DRIVER.SYS
...


=== LIMITATIONS ===

- provides up to 64 MB of XMS
- obviously slower than direct EMS access because of the translation layer
- doesn't provide XMS functions related to UMB, HMA, A20 and 32-bit addressing


=== HISTORY ===

v0.9.2 [25 JUL 2025]
 - EMS moves never cross page boundaries (avoids corruption on some EMS cards)
 - far pointers are normalized before passing to EMS (needed by some EMS cards)
 - 0-bytes transfers are not relayed to EMS (always succeed)

v0.9.1 [19 JUL 2025]
 - fixed return code of XMS realloc requests
 - minor relocations for smaller memory footprint
 - cooperation with UMB/HMA providers
 - help screen

v0.9   [16 JUL 2025]
 - initial release


=== LICENSE ===

EXMS86 is published and distributed under the terms of the MIT license:

Copyright (C) 2025 Mateusz Viste

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
