
; Demumb.inc - DOS Emulation include file for UMB support
;********************************************************************** ;BN001;
; REVISION HISTORY                                                      ;BN001;
;                                                                       ;BN001;
;  B001  DCR 1329 - 2/16/91 TMB -  File Created.                        ;BN001;
;                                                                       ;BN001;
;                   Add support for loading DOS device                  ;BN001;
;                   drivers and TSRs into UMBs.                         ;BN001;
;                                                                       ;BN001;
;                   Module dependencies:                                ;BN001;
;                   drv6\src\dos\v86code\v86init.asm                    ;BN001;
;                   drv6\src\dos\v86code\demarena.asm                   ;BN001;
;                   drv6\src\dos\v86code\demcnst.asm                    ;BN001;
;                   drv6\src\dos\v86code\demproc.asm                    ;BN001;
;                   drv6\src\dos\v86code\demexec.asm                    ;BN001;
;                   drv6\src\dos\v86code\demumb.inc                     ;BN001;
;                   drv6\src\vdev\vbios.c                               ;BN001;
;                   drv6\src\vdev\propname.h                            ;BN001;
;                   drv6\inc\vdmprop.inc                                ;BN001;
;                   drv6\h\vdmprop.h                                    ;BN001;
;                   drv6\src\dos\mvdm\dem.c                             ;BN001;
;********************************************************************** ;BN001;
;  B002  PTR B721329 -4/26/91  EMK-Add symbols to define XMS interface  ;BN003;
;                                                                       ;BN001;
;       UMB_FLAG  bit definitions                                       ;BN001;
;                                                                       ;BN001;
;********************************************************************** ;BN004;
; 23Jan92 - G.L.Fulk                                                    ;BN004;
; Wrong equate name.                                                    ;BN004;
;********************************************************************** ;BN004;
;  18Aug92 - G.L.Fulk                                                   ;BN006;
;  Change the UmbFlag variable from word to byte.                       ;BN006;
;********************************************************************** ;BN006;


LINKSTATE       EQU     00000001b       ;indicates link state of UMBs   ;BN001;
                                        ; (UMBs chain linked to DOS     ;BN001;
                                        ; arena chain)                  ;BN001;
                                        ; 1 = linked   0 = not linked   ;BN001;
NOLINKUMBS      EQU     10000000b       ;indicates whether the UMBs are ;BC006;
                                        ;linkable.                      ;BN001;
                                        ; 0 = can link 1 = can't link   ;BN001;
UMBAVAIL        EQU     01000000b       ;indicates whether UMBs are     ;BC006;
                                        ;supported                      ;BN001;
                                        ; (ie. DOS=UMB, XMS providing   ;BN001;
                                        ;  UMBs, and UMB_HEAD is valid) ;BN001;
                                        ; 1= supported, 0= not supported;BN001;
NOUMBS          EQU     00100000b       ;DOS=UMBs will RESET this flag  ;BC006;
                                        ;When DOS=UMBS (NOUMBS=0), the  ;BN001;
                                        ;DOS apps will not be able to   ;BN001;
                                        ;use XMS to get UMBs. They will ;BN001;
                                        ;have to specify DOS=NOUMBS     ;BN001;
                                        ;(NOUMBS=1) to access UMBs via  ;BN001;
                                        ;XMS.                           ;BN001;
                                        ; 0 = DOSOWNS UMBs              ;BN001;
                                        ; 1 = DOS does NOT own UMBs     ;BN001;
DOSALLOC        EQU     00010000b       ; 1 = this is a kernel request  ;BC006;
                                        ; 0=this is not a kernel request;BN001;
                                        ; If set, when UMBs are not in  ;BN001;
                                        ; linked $alloc will search UMBs;BN001;
                                        ; anyway                        ;BN001;
;                                                                       ;BN001;
;                                                                       ;BN001;
;       XMS - UMB  request equates                                      ;BN001;
;                                                                       ;BN001;
;Interface to XMS:
;XMS can be accessed via the multiplexor interrupt, 2FH, using the
;XMS id of 43H in AH.  The functions supported in AL are:
;  AL=0 - are you there? If AL=80h on return, XMS is NOT there.
;  AL=10H -where are you? ES:BX set to point to the XMS entry point.
;Interface to XMS via entry point returned above:
;  AH=10h - get XMS memory allocated, needs DX=num para desired
;    output: if AL=1, the desired memory was allocated
;               and BX=segid of allocated block

;            if AL=0, desired mem not available:
;               BL = 80h  function not implemented
;               BL = B0h  smaller UMB available
;               BL = B1h  no UMBs available
;               DX = size of largest available UMB in paragraphs

XMM_MPX_ID         EQU   43H         ;The XMS multiplexor id            ;BN003;

;-------------- multiplexor command byte:
XMM_R_U_THERE      EQU   00H         ;AL=0, ARE YOU THERE?              ;BN003;
XMM_WHERE_R_U      EQU   10H         ;AL=10H, WHERE ARE YOU?            ;BN003;

;-------------- multiplexor return codes in AL:
XMM_IS_THERE       EQU   80H         ;AL returned flag if XMS is there  ;BN004;

;-------------- command byte to XMS in AH:
XMM_GET_VERSION    EQU   00h         ;get XMS version number
XMM_REQUEST_HIMEM  EQU   01h         ;request HMA                       ;BN003;
;                  EQU   02h         ;release HMA
XMM_ENABLE_A20     EQU   03h         ;global enable A20                 ;BN003;
XMM_DISABLE_A20    EQU   04h         ;global disable A20
;                  EQU   05h         ;local enable A20
;                  EQU   06h         ;local disable A20
;                  EQU   07h         ;query A20
XMM_QUERY_FREE_XMS EQU   08h         ;query free extended memory
;                  EQU   09h         ;allocate extended memory block
;                  EQU   0Ah         ;free extended memory block
;                  EQU   0Bh         ;move extended memory block
;                  EQU   0Ch         ;lock extended memory block
;                  EQU   0Dh         ;unlock extended memory block
;                  EQU   0Eh         ;get handle information
;                  EQU   0Fh         ;reallocate extended memory block
XMM_REQUEST_UMB    EQU   10h         ;request UMB                       ;BN003;
;                  EQU   11h         ;release UMB

;-------------- XMS return codes in AL:
XMM_REQUEST_OK     EQU   01H         ;AL ret code= mem allocated        ;BN003;
XMM_NO_UMB         EQU   00H         ;AL ret code=no UMBs available     ;BN003;

;-------------- XMS error codes in BL (when AL=0)
XMM_NOT_IMP        EQU   80h         ;function not implemented          ;BN003;
;                  EQU   81h         ;a VDISK device is detected
;                  EQU   82h         ;an A20 error occurs
;                  EQU   8Eh         ;a general driver error occurs
;                  EQU   8Fh         ;an unrecoverable driver error
;                  EQU   90h         ;the HMA does not exist
;                  EQU   91h         ;the HMA is already in use
;                  EQU   92h         ;DX is less than the /HMAMIN
;                  EQU   93h         ;the HMA is not allocated
;                  EQU   94h         ;the A20 line is still enabled
;                  EQU   0A0h        ;all extended memory is allocated
;                  EQU   0A1h        ;all available extended mem handles are in use
;                  EQU   0A2h        ;the handle is invalid
;                  EQU   0A3h        ;the SourceHandle is invalid
;                  EQU   0A4h        ;the SourceOffset is invalid
;                  EQU   0A5h        ;the DestHandle is invalid
;                  EQU   0A6h        ;the DestOffset is invalid
;                  EQU   0A7h        ;the length is invalid
;                  EQU   0A8h        ;the move has an invalid overlap
;                  EQU   0A9h        ;a parity error occurs
;                  EQU   0AAh        ;the block is not locked
;                  EQU   0ABh        ;the block is locked
;                  EQU   0ACh        ;the block's lock count overflows
;                  EQU   0ADh        ;the lock fails
XMM_SMALLER_AVAIL  EQU   0B0H        ;smaller UMB available             ;BN003;
XMM_NONE_AVAIL     EQU   0B1H        ;no UMBs available                 ;BN003;
;                  EQU   0B2h        ;the UMB segment number is invalid

