include vmm.inc
VMMCall _MMGR_Toggle_HMA, <VM, flags>
cmp flags, MMGRHMAQuerry
jne did_toggle
mov [HMAState], eax ; 0 if disabled, 1 if enabled
did_toggle:
or eax, eax ; nonzero if enabled/disabled, zero if error
jz error
Enables or disables the high memory area (HMA). The V86MMGR XMS device uses this service to control the state of the HMA for a specified virtual machine, and to notify the instance data manager that the state is changing. If your virtual device needs to toggle the HMA, use the V86MMGR_Toggle_HMA service instead of this one. This service is for exclusive use by the V86MMGR XMS device. Uses EAX.
If the flags parameter specifies the MMGRHMAQuerry operation, the service returns a nonzero value if the HMA is enabled, and zero if disabled.
Value | Meaning |
---|---|
MMGRHMADisable | Disables the HMA, causing addresses greater than 1 megabyte to be wrapped back to addresses in pages 0 through 0Fh. |
MMGRHMAEnable | Enables the HMA, allowing addresses greater than 1 megabyte to access pages 100h through 10Fh. If the MMGRHMAPhysical value is given, the service maps physical pages 100h through 10Fh into the linear pages 100h through 10Fh for the virtual machine, enabling the global HMA for this virtual machine and which all virtual machines share.
the MMGRHMAPhysical value is not given, the service marks the linear pages 100h through 10Fh as not present system pages. To prevent a system crash when these pages are accessed, the virtual device must provide its own physical pages to map into these linear pages. This effectively creates a local HMA that is specific to the given virtual machine. |
MMGRHMAQuerry | Returns the current state of the HMA for the virtual machine. |
MMGRHMAPhysical | Specifies whether the service maps physical pages 100h through 10Fh into the HMA or expects the virtual device to map some other physical pages into the area. The value is used only if the MMGRHMAEnable value is also given. |
The MMGRHMAEnable, MMGRHMADisable, MMGRHMAQuerry values are mutually exclusive.
All other values are reserved.
This service can fail if the MMGRHMAEnable and MMGRHMAPhysical values are given, but the system is already using the physical pages 100h through 10Fh for some other purpose.
A virtual device must not call this service unless it has already used the _Assign_Device_V86_Pages service to assign the pages 100h through 10Fh to itself. For this reason, this service is intended to be used by one and only one virtual device.
When the system creates a virtual machine, it disables the HMA and causes the virtual machine to operate like an 8086 processor. To override this default, the virtual device responsible for the HMA must enable the HMA while processing the VM_Critical_Init message.
Virtual devices must not identify instance data in the HMA.
_Assign_Device_V86_Pages, VM_Critical_Init