Interrupt 2Fh Function 4000h

mov ax, 4000h             ; Enable VM-Assisted Save/Restore
int 2fh

mov [ModesSupported], al  ; video modes supported while in background
 

Enable VM-Assisted Save/Restore directs the virtual-display device (VDD) to notify the virtual machine (VM) application whenever the VDD needs to access the video hardware registers. The VDD returns a value specifying the number and type of video modes the VDD supports when the VM application is in the background.

A VM application calls this function during its initialization.

This function has no parameters.

The return value is one of the following values, if successful. Otherwise, the function returns zero in the AL register if virtualization is not supported.

Value Meaning
01h No modes virtualized in background.
02h Only text modes virtualized in background.
03h Only text and single-plane graphics modes virtualized.
04h Only text, single-plane, and VGA multiplane graphics modes virtualized.
0FFh All supported video modes virtualized.

When a VM application calls this function, the VDD disables I/O trapping of unreadable registers. Thereafter, the VDD calls Save Video Register State and Restore Video Register State (Interrupt 2Fh Functions 4005h and 4006h) if it needs to access the video registers. The VM application must provide an appropriate interrupt handler to process these functions.

When an VM application calls this function, the VDD saves the current state of the video registers. The VDD uses this saved state later to restore video registers before it calls Notify Foreground Switch and Restore Video Register State (Interrupt 2Fh Functions 4002h and 4006h).

After a VM application calls Enable VM-Assisted Save/Restore, the VDD no longer saves video memory across screen switches; it becomes the application's responsibility to completely reinitialize video memory after a Notify Foreground Switch request.

See Also

Interrupt 2Fh Function 4002h Notify Foreground Switch,
Interrupt 2Fh Function 4005h Save Video Register State,
Interrupt 2Fh Function 4006h Restore Video Register State