Introduction to Virtual Device Drivers



Download 274.5 Kb.
Page69/80
Date19.01.2022
Size274.5 Kb.
#58083
1   ...   65   66   67   68   69   70   71   72   ...   80
VXDS
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.

Otherwise, the function returns zero in the AL register if virtualization is not supported.

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

Interrupt 2Fh Function 4001h

mov ax, 4001h ; Notify Background Switch

int 2fh
Notify Background Switch notifies a VM application that it is being switched to the background. The VM application can carry out any actions, but should do so within 1000ms. This is the amount of time the system waits before switching the application.

This function has no parameters.

 This function has no return value.

After switching to the background, the application continues to run unless it attempts to access video memory. If the video adapter is in a video mode that the virtual display device (VDD) does not support in the background, the VDD freezes the application until the application can be switched back to the foreground.

VM applications that have called Enable VM-Assisted Save/Restore (Interrupt 2Fh Function 4000h) should avoid accessing video memory and registers to avoid being frozen. Applications that have not called Enable VM-Assisted Save/Restore, call access video memory and registers since the VDD saves theses after this function returns.

See also Interrupt 2Fh Function 4000h Enable VM-Assisted Save/Restore,

Interrupt 2Fh Function 4002h Notify Foreground Switch

Interrupt 2Fh Function 4002h

mov ax, 4002h ; Notify Foreground Switch

int 2fh
Notify Foreground Switch notifies a VM application that it has been switched to the foreground and can now access the video memory and registers without being frozen.

The virtual-display device (VDD) calls this function.

This function has no parameters.

 This function has no return value.

If the VM application has called Enable VM-Assisted Save/Restore (Interrupt 2Fh Function 4000h), VDD restores the video registers to their state prior to the call to Enable VM-Assisted Save/Restore; the application is responsible for restoring video memory. If the VM application has not called Enable VM-Assisted Save/Restore (Interrupt 2Fh Function 4000h), the VDD automatically restores both video memory and registers.

Under certain error conditions, the VDD may call this function without calling a corresponding Notify Background Switch (Interrupt 2Fh Function 4001h).

See also Interrupt 2Fh Function 4000h Enable VM-Assisted Save/Restore,

Interrupt 2Fh Function 4001h Notify Background Switch



Interrupt 2Fh Function 4003h

mov ax, 4003h ; Enter Critical Section

int 2fh
Enter Critical Section notifies the virtual-display device that the VM application has entered a critical section and cannot respond to Save Video Register State (Interrupt 2Fh Function 4005h).

A VM application calls this function when it has started critical section processing.

This function has no parameters.

 This function has no return value.

After the VM application enters the critical section, the virtual-display device postpones calling Save Video Register State for up to 1000ms or until the VM application calls Exit Critical Section (Interrupt 2Fh Function 4004h), whichever comes first.

If time elapses without the VM application calling Exit Critical Section, the virtual-display device reprograms the video hardware anyway and, when its operation is complete, calls Notify Foreground Switch (Interrupt 2Fh Function 4002h) in an attempt to reinitialize the application properly.

See also Interrupt 2Fh Function 4002h Notify Foreground Switch,

Interrupt 2Fh Function 4004h Exit Critical Section,

Interrupt 2Fh Function 4005h Save Video Register State

Interrupt 2Fh Function 4004h

mov ax, 4004h ; Exit Critical Section

int 2fh
Exit Critical Section notifies the virtual-display device that a VM application has completed a critical section and can now respond to Save Video Register State (Interrupt 2Fh Function 4005h).

A VM application calls this function when it has completed critical section processing.

This function has no parameters.

 This function has no return value.

Calls to Exit Critical Section not preceded by a corresponding call to Enter Critical Section (Interrupt 2Fh Function 4003h) are ignored.

See also Interrupt 2Fh Function 4003h Enter Critical Section,

Interrupt 2Fh Function 4005h Save Video Register State

Interrupt 2Fh Function 4005h

mov ax, 4005h ; Save Video Register State

int 2fh
The Save Video Register State function notifies VM applications that the virtual-display device (VDD) requires access to the video hardware registers. The VDD calls this function, for example, when preparing to copy the entire screen to the clipboard.

This function has no parameters.

 This function has no return value.

The VDD calls this function only if the VM application has called Enable VM-Assisted Save/Restore (Interrupt 2Fh Function 4000h). VM applications that receive Save Video Register State must save any data necessary to restore the current video state and must return within 1000ms. If the application fails to return in time, the virtual-display device accesses the video hardware anyway. After accessing the video hardware registers, the VDD calls Restore Video Register State (Interrupt 2Fh Function 4006h) to notify the application that it can restore its video state.

The VDD calls Save Video Register State only at times when the hardware must be reprogrammed for what are essentially brief and nonvisible operations. For example, the VDD does not call this function prior to calling Notify Background Switch (Interrupt 2Fh Function 4001h).

See also Interrupt 2Fh Function 4000h Enable VM-Assisted Save/Restore,

Interrupt 2Fh Function 4001h Notify Background Switch,

Interrupt 2Fh Function 4006h Restore Video Register State



Interrupt 2Fh Function 4006h

mov ax, 4006h ; Restore Video Register State

int 2fh
Restore Video Register State notifies a VM application that the virtual-display device (VDD) has relinquished its access to the video registers. The VM application should restore the video registers to any state necessary to continue uninterrupted foreground operation.

This function has no parameters.

 This function has no return value.

The VDD calls this function only if the VM application has called Enable VM-Assisted Save/Restore (Interrupt 2Fh Function 4000h). Before calling this function, the VDD restores any registers it modified to the values they had when the VM application originally called Enable VM-Assisted Save/Restore. In other words, every register is guaranteed to be either unchanged or reset to a previous state; precisely which registers may be reset is undefined, but the set is restricted to those Sequencer and Graphics Controller registers that do not affect the display.

See also Interrupt 2Fh Function 4000h Enable VM-Assisted Save/Restore

Interrupt 2Fh Function 4007h

mov ax, 4007h ; Disable VM-Assisted Save/Restore

int 2fh
Disable VM-Assisted Save/Restore directs the virtual-display device (VDD) to discontinue notifying the VM application when it needs access to video registers.

VM applications call this function when they terminate.

This function has no parameters.

 This function has no return value.

This function directs the VDD to restore I/O trapping of unreadable registers and to discontinue calling Save Video Register State and Restore Video Register State (Interrupt 2Fh Functions 4005h and 4006h) when it needs access to the registers. Furthermore, the VDD ignores any subsequent calls to Enter Critical Section and Exit Critical Section (Interrupt 2Fh Functions 4003h and 4004h).

This function does not disable Notify Background Switch and Notify Foreground Switch (Interrupt 2Fh Functions 4001h and 4002h).

See also Interrupt 2Fh Function 4001h Notify Background Switch,

Interrupt 2Fh Function 4002h Notify Foreground Switch,

Interrupt 2Fh Function 4003h Enter Critical Section,

Interrupt 2Fh Function 4004h Exit Critical Section,

Interrupt 2Fh Function 4005h Save Video Register State,

Interrupt 2Fh Function 4006h Restore Video Register State





Download 274.5 Kb.

Share with your friends:
1   ...   65   66   67   68   69   70   71   72   ...   80




The database is protected by copyright ©ininet.org 2024
send message

    Main page