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 |
The _MMGR_Toggle_HMA service 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.
This service is for exclusive use by the V86MMGR XMS device.
VM
Specifies a handle identifying the virtual machine.
flags
Specifies the operation flags. It can be one of the following values:
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. |
If 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.
If MMGRHMAEnable or MMGRHMADisable are given, the EAX register contains a nonzero value if the service is successful. Otherwise, EAX contains zero to indicate an error.
If the MMGRHMAQuerry value is given, the EAX register contains a nonzero value if the HMA is enabled and zero if the HMA is disabled.
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.
EAX