include vmm.inc VMMcall Begin_Nest_Exec |
The Begin_Nest_Exec service starts a nested execution block. This service is used in conjunction with the End_Nest_Exec service to create a nested execution block in which a virtual device may call the Exec_Int and Resume_Exec services. Virtual devices use these services to call software in the virtual machine.
This service has no parameters.
The Client_CS and Client_IP registers contain a break point used by nested execution services.
While in a nested execution block, a virtual device may call the Exec_Int and Resume_Exec services any number of times.
If one of these calls changes the virtual machine registers, these changes are also made to the client state. Before creating the nested execution block, a virtual device should save the client state by using the Save_Client_State service. After ending the nested execution block, a virtual device should restore the client state by using the Restore_Client_State service.
This service forces the virtual machine into protected-mode execution if there is a protected-mode application running in the current virtual machine. Otherwise, the virtual machine remains in V86 mode. The End_Nest_Exec service restores the virtual machine to its mode prior to the call to Begin_Nest_Exec.
If the execution mode changes to protected mode, this service automatically switches the virtual machine to the locked protected-mode stack and End_Nest_Exec switches it back. This allows most devices to change execution modes without worrying about demand paging issues.
The following example shows a nested call to the MS-DOS function Get Version (Interrupt 21h, Function 30h):
VMMcall Begin_Nest_Exec ; start nested execution
mov [ebp.Client_AH], 30h ; 30h = get MS-DOS version #
mov eax, 21h ; Execute an Int 21h in the
VMMcall Exec_Int ; current VM to call MS-DOS
VMMcall End_Nest_Exec ; end of nested exec calls
This example copies the MS-DOS version to the Client_AH and Client_AL registers.
Client_CS, Client_IP, Flags
Begin_Nest_V86_Exec, End_Nest_Exec, Exec_Int, Restore_Client_State, Resume_Exec, Save_Client_State, Set_PM_Exec_Mode, Set_V86_Exec_Mode