Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Ralf Brown's Interrupt List (Part 1,2) - int 2f - multiplex - xms - get driver address http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
INT 2F - Multiplex - XMS - GET DRIVER ADDRESS
        AX = 4310h
Return: ES:BX -> driver entry point
SeeAlso: AX=4300h

Perform a FAR call to the driver entry point with AH set to the function code
        AH      function
        00h  Get XMS version number
             Return: AX = XMS version (in BCD)
                     BX = internal revision number
                     DX = 0001h if HMA (1M to 1M + 64K) exists
                          0000h if HMA does not exist
        01h  Request High Memory Area (1M to 1M + 64K)
             DX = memory in bytes (for TSR or device drivers)
                  FFFFh if application program
             Return: AX = 0001h success
                        = 0000h failure
                           BL = error code (see below)
        02h  Release High Memory Area
             Return: AX = 0001h success
                        = 0000h failure
                           BL = error code (see below)
        03h  Global enable A20, for using the HMA
             Return: AX = 0001h success
                        = 0000h failure
                           BL = error code (see below)
        04h  Global disable A20
             Return: AX = 0001h success
                        = 0000h failure
                           BL = error code (see below)
        05h  Local enable A20, for direct access to extended memory
             Return: AX = 0001h success
                        = 0000h failure
                           BL = error code (see below)
        06h  Local disable A20
             Return: AX = 0001h success
                        = 0000h failure
                           BL = error code (see below)
        07h  Query A20 state
             Return: AX = 0001h enabled
                        = 0000h disabled
                     BL = error code (0 = successful)
        08h  Query free extended memory, not counting HMA
             Return: AX = size of largest extended memory block in K
                     DX = total extended memory in K
                     BL = error code (see below)
        09h  Allocate extended memory block
             DX = Kbytes needed
             Return: AX = 0001h success
                           DX = handle for memory block
                        = 0000h failure
                           BL = error code (see below)
        0Ah  Free extended memory block
             DX = handle of block to free
             Return: AX = 0001h success
                        = 0000h failure
                           BL = error code (see below)
        0Bh  Move extended memory block
             DS:SI -> EMM structure (see below)
             Note: if either handle is 0000h, the corresponding offset is
                   considered to be an absolute segment:offset address in
                   directly addressable memory
             Return: AX = 0001h success
                        = 0000h failure
                           BL = error code (see below)
        0Ch  Lock extended memory block
             DX = handle of block to lock
             Return: AX = 0001h success
                           DX:BX = 32-bit linear address of locked block
                        = 0000h failure
                           BL = error code (see below)
        0Dh  Unlock extended memory block
             DX = handle of block to unlock
             Return: AX = 0001h success
                        = 0000h failure
                           BL = error code (see below)
        0Eh  Get handle information
             DX = handle for which to get info
             Return: AX = 0001h success
                           BH = block's lock count
                           BL = number of free handles left
                           DX = block size in K
                        = 0000h failure
                           BL = error code (see below)
        0Fh  Reallocate extended memory block
             DX = handle of block
             BX = new size of block in K
             Return: AX = 0001h success
                        = 0000h failure
                           BL = error code (see below)
        10h  Request upper memory block (nonEMS memory above 640K)
             DX = size of block in paragraphs
             Return: AX = 0001h success
                           BX = segment address of UMB
                           DX = actual size of block
                        = 0000h failure
                           BL = error code (see below)
                           DX = largest available block
        11h  Release upper memory block
             DX = segment address of UMB to release
             Return: AX = 0001h success
                        = 0000h failure
                           BL = error code (see below)
Note:   HIMEM.SYS requires at least 256 bytes free stack space

Format of EMM structure:
Offset  Size    Description
 00h    DWORD   number of bytes to move (must be even)
 04h    WORD    source handle
 06h    DWORD   offset into source block
 0Ah    WORD    destination handle
 0Ch    DWORD   offset into destination block

Error codes returned in BL:
        80h Function not implemented
        81h Vdisk was detected
        82h An A20 error occurred
        8Eh a general driver error
        8Fh unrecoverable driver error
        90h HMA does not exist
        91h HMA is already in use
        92h DX is less than the /HMAMIN= parameter
        93h HMA is not allocated
        94h A20 line still enabled
        A0h all extended memory is allocated
        A1h all available extended memory handles are allocated
        A2h Invalid handle
        A3h Source handle is invalid
        A4h Source offset is invalid
        A5h Destination handle is invalid
        A6h Destination offset is invalid
        A7h Length is invalid
        A8h Move has an invalid overlap
        A9h Parity error occurred
        AAh Block is not locked
        ABh Block is locked
        ACh Block lock count overflowed
        ADh Lock failed
        B0h Only a smaller UMB is available
        B1h No UMB's are available
        B2h UMB segment number is invalid

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson