-*- Text -*-
   This is the file .../info/DOSExt.nfo, which contains info
about the services unprovided by the DOS. It is intended for use by the
MOOSE developpers not to look into books each time they need this information.
It does not try to incorporate all the info about the DOS, only that needed
by MOOSE.

    Info taken from:
- The PC system programming BIBLE (Third Edition) by Michael Tischer, 1993

File: DOSAdd.nfo		Node: Top	Up:(MOOSE.nfo)

   This file describes the functions of standard DOS enhancements.

* Menu:

About those DOS Enhancements:
* Intro::			Can DOS really be enhanced ?

How to Enhance DOS:
* Device Drivers::		Add some functionality at boot time.
* TSR's::			Modify interrupts tables at run time.
* DOS "Extenders"::		Go to P.M. and use DOS.
* DOS Emulators::		Simulate DOS from another OS.
* Detecting Enhancements::	Methods to detect enhancements.
* The Multiplexer::		One particular method some standard devices use

DOS Enhancements::
* Mouse::			Mouse (or another pointer) device driver
* Print Spooler::		Spooler for printing in background
* VESA Graphics::		Video extensions
* NetWare::			Exchanging data over a net

Protected Mode Access::
* BIOS Services::		Quick summary of BIOS Services for PM.
* EMS::				Expanded Memory Specs
* XMS::				eXtended Memory Specs
* DPMI::			DOS Protected Mode Interface
* VCPI::			Virtual Control Programming Interface

Node: Multiplexer, Up: Top

   Int 2Fh is used as a "Multiplexer" (MUX) that offers gates to some standard
DOS enhancements. Each device that uses the multiplexer has a function number
(in AH as always), and provides sub-functions (in AL as always). Subfunction
00h should be used to detect if the Multiplexed device is present (or if the
function number is already used).

Function number		Utility
---------------		-------
* MUX 01h::		PRINT, the Print Spooler
* MUX 06h::		ASSIGN, the DOS drive redirector
* MUX 10h::		SHARE
* MUX 16h::		DPMI calls.
* MUX 1Ah::		ANSI.SYS
* MUX 43h::		(HIMEM.SYS), the XMS (eXtended Memory) manager
* MUX 48h::		DOSKEY
* MUX ADh::		KEYB
* MUX B0h::		GRAFTABL
* MUX B7h::		APPEND

Node: Mouse, Up: Top

   The Mouse interface uses interruption Int 33h.

Node: VCPI, Up: Top

   The Virtual Control Programming Interface was edited in 1989 by a Consortium
of software vendors leaded by Phar Lap (editor of DOS extenders) and
QuarterDeck (editor of DESQView and QEMM) for i386 machines. Most EMS managers
accept this standard (including those going with MS-DOS or DR-DOS).

   VCPI is condemned by the appearance of DPMI, so don't you use it !

   Using VCPI:
   ----------
   To use VCPI, you must first get some EMS pages, 'cause some EMM need this
to activate themselves and VCPI...
   I hate EMS, so, goodbye !

Node: DPMI, Up: Top

   DPMI is Microsoft Windows 3 's DOS Extender, and as such is the new DOS
Extender standard. In 1990, it was published and extended by a committee
with Microsoft, Borland, Intel, Eclipse, IBM, Lotus, Phar Lap, QuarterDeck
and Rational Systems.
   A DPMI server is called the "host", and programs using it are its clients.
Each client is basically a monotasking VM86 task, but can execute in 32 bit
mode.
   Of course, there are many many problems, because the 0.9 DPMI version is
broken, as it has clients share the same LDT and IDT, which is among other
things a security hole. Moreover, while the 1.0 version fixes this problem, it
is incompatible with version 0.9, and programs must be modified, so Windows
will stick to version 1.0 (isn't it complicated !).


   See the PC BIBLE 3rd (french) Edition, PAGE 1206

   Using DPMI:
   ----------
   DPMI puts you in 32 bit mode; it translates DOS calls so that Int 21h and
other DOS interrupts (which ?) still work as expected, and offers a new Int 31h
services. DPMI offers separate calls to manage memory allocation and selector
allocation.

The Multiplexer part:
* Int 2Fh Function 1680h::	Leave hand when not busy.
* Int 2Fh Function 1686h::	Read Operating Mode (=PM ?)
* Int 2Fh Function 1687h::	Detecting DPMI

The Int 31h calls (when already in protected mode only).
LDT Management:
* DPMI Fun 0000h::		Allocate LDT segment descriptor
* DPMI Fun 0001h::		Free LDT segment descriptor
* DPMI Fun 0002h::		Reproduce Real Mode segment into a selector
* DPMI Fun 0003h::		Read offset for selectors
* DPMI Fun 0004h::		Disable swapping for a selected segment
* DPMI Fun 0005h::		(Re)Enable swapping for a selected segment
* DPMI Fun 0006h::		Read segment's base address
* DPMI Fun 0007h::		Set segment's base address
* DPMI Fun 0008h::		Set segment's length
* DPMI Fun 0009h::		Set segment's right accesses and type
* DPMI Fun 000Ah::		Create an Alias for a code segment
* DPMI Fun 000Bh::		Read a segment descriptor
* DPMI Fun 000Ch::		Load a segment descriptor
* DPMI Fun 000Dh::		Reclaim a selector
DOS Memory Management:
* DPMI Fun 0100h::		Allocate DOS memory
* DPMI Fun 0101h::		Free DOS memory
* DPMI Fun 0102h::		Reallocate DOS memory
Interrupts and exceptions management:
* DPMI Fun 0200h::		Read addr of a Real mode interrupt manager
* DPMI Fun 0201h::		Install a new interrupt manager
* DPMI Fun 0202h::		Read the address of an exception manager
* DPMI Fun 0203h::		Install a new exception manager
* DPMI Fun 0204h::		Read the address of a PM interrupt manager
* DPMI Fun 0205h::		Install a new Protected Mode interrupt manager
* DPMI Fun 0900h::		Disable the virtual interrupt flag
* DPMI Fun 0901h::		Enable the virtual interrupt flag
* DPMI Fun 0902h::		Read the virtual interrupt flag
Calling Real-Mode routines:
* DPMI Fun 0300h::		Simulate (call) a Real-Mode interrupt
* DPMI Fun 0301h::		call a Real-Mode routine
* DPMI Fun 0302h::		(same ?)
* DPMI Fun 0303h::		Generate a call-back
* DPMI Fun 0304h::		Return a call-back
Miscellaneous Functions:
* DPMI Fun 0400h::		Read DPMI Version number
Functions to access extended memory:
* DPMI Fun 0500h::		Read memory allocation informations
* DPMI Fun 0501h::		Allocate extended memory
* DPMI Fun 0502h::		Free extended memory
* DPMI Fun 0503h::		Reallocate extended memory
* DPMI Fun 0800h::		Convert physical to linear address
Swapping managing functions:
* DPMI Fun 0600h::		Lock a memory zone against swapping
* DPMI Fun 0601h::		Unlock a memory zone
* DPMI Fun 0601h::		Lock a real memory zone against swapping
* DPMI Fun 0601h::		Unlock a real memory zone against swapping
* DPMI Fun 0601h::		Read page size
* DPMI Fun 0702h::		Priviledge a memory zone for non-swapping (?)
* DPMI Fun 0703h::		Protect a memory zone against writing
Support for i386 debugging registers:
* DPMI Fun 0B00h::		Define a watch point
* DPMI Fun 0B01h::		Delete a watch point
* DPMI Fun 0B02h::		Read the state of a watch point
* DPMI Fun 0B03h::		Reinit a watch point

Registers:
* BX:CX is length
* SI:DI is a handle

(Note: DOOM uses DPMI, so perhaps if we emulate DPMI, we can run DOOM !!!)

Node: Int 2Fh Function 1680h, Up: DPMI

		Leave hand

   Call this function so that other tasks will be able to use your wait time.


Node: Int 2Fh Function 1687h, Up: DPMI

		Detecting DPMI

* If not present, AX is non null
* If present, AX=0,
   The bit 0 of BX is set iff the host is a 32-bit host, (0:16-bit host only)
   CL contains an identifier of the Processor type,
   DX contains the version of the DPMI host.
   SI contains the size of a memory block the host needs to go into PM.
   ES:DI points to a routine that put you into Protected Mode.

* If you far call ES:DI, it will jump into protected mode, with CS, DS, and SS
   being selectors to 16-bit segments addressing the same memory as their
   real-mode (VM86 mode) value before the call; ES points to a 100h segment
   containing the PSP, and FS and GS are cleared.
* DPMI enables its Int 31h functions.
* You may end DPMI by calling int 21h, function 4Ch.

		
