📄 vmm.inc
字号:
VMStat_Not_Executeable_Bit EQU 4
VMStat_PM_Exec EQU 000000000000000100000b ; Currently in PM app
VMStat_PM_Exec_Bit EQU 5
VMStat_PM_App EQU 000000000000001000000b ; PM app present in VM
VMStat_PM_App_Bit EQU 6
VMStat_PM_Use32 EQU 000000000000010000000b ; PM app is 32-bit
VMStat_PM_Use32_Bit EQU 7
VMStat_VxD_Exec EQU 000000000000100000000b ; Call from VxD
VMStat_VxD_Exec_Bit EQU 8
VMStat_High_Pri_Back EQU 000000000001000000000b ; High pri background
VMStat_High_Pri_Back_Bit EQU 9
VMStat_Blocked EQU 000000000010000000000b ; Blocked on semaphore
VMStat_Blocked_Bit EQU 0Ah
VMStat_Awakening EQU 000000000100000000000b ; Woke up after blocked
VMStat_Awakening_Bit EQU 0Bh
VMStat_PageableV86 EQU 000000001000000000000b ; part of V86 is pageable (PM app)
VMStat_PageableV86Bit EQU 0Ch
VMStat_V86IntsLocked EQU 000000010000000000000b ; Rest of V86 is locked
VMStat_V86IntsLockedBit EQU 0Dh ; regardless of pager type
VMStat_TS_Sched EQU 000000100000000000000b ; Scheduled by time-slicer
VMStat_TS_Sched_Bit EQU 0Eh
VMStat_Idle EQU 000001000000000000000b ; VM has released time
VMStat_Idle_Bit EQU 0Fh ; slice
VMStat_Closing EQU 000010000000000000000b ; Close_VM called for VM
VMStat_Closing_Bit EQU 10h
VMStat_Use32_Mask EQU VMStat_PM_Use32 OR VMStat_VxD_Exec
;*******
; Add this value to a V86 linear address to get address of VM's memory in
; the VMM linear address space
CB_High_Linear EQU DWORD PTR 04h
;*******
CB_Client_Pointer EQU DWORD PTR 08h
CB_VMID EQU DWORD PTR 0Ch
;
; Equates for protected mode application control blocks
;
PMCB_Flags EQU DWORD PTR 00h
PMCB_Parent EQU DWORD PTR 04h
EndDoc
;******************************************************************************
; V M M S E R V I C E S
;******************************************************************************
Begin_Service_Table VMM, VMM
VMM_Service Get_VMM_Version, LOCAL ; MUST REMAIN SERVICE 0!
VMM_Service Get_Cur_VM_Handle
VMM_Service Test_Cur_VM_Handle
VMM_Service Get_Sys_VM_Handle
VMM_Service Test_Sys_VM_Handle
VMM_Service Validate_VM_Handle
VMM_Service Get_VMM_Reenter_Count
VMM_Service Begin_Reentrant_Execution
VMM_Service End_Reentrant_Execution
VMM_Service Install_V86_Break_Point
VMM_Service Remove_V86_Break_Point
VMM_Service Allocate_V86_Call_Back
VMM_Service Allocate_PM_Call_Back
VMM_Service Call_When_VM_Returns
VMM_Service Schedule_Global_Event
VMM_Service Schedule_VM_Event
VMM_Service Call_Global_Event
VMM_Service Call_VM_Event
VMM_Service Cancel_Global_Event
VMM_Service Cancel_VM_Event
VMM_Service Call_Priority_VM_Event
VMM_Service Cancel_Priority_VM_Event
VMM_Service Get_NMI_Handler_Addr
VMM_Service Set_NMI_Handler_Addr
VMM_Service Hook_NMI_Event
VMM_Service Call_When_VM_Ints_Enabled
VMM_Service Enable_VM_Ints
VMM_Service Disable_VM_Ints
VMM_Service Map_Flat
VMM_Service Map_Lin_To_VM_Addr
;
; Scheduler services
;
VMM_Service Adjust_Exec_Priority
VMM_Service Begin_Critical_Section
VMM_Service End_Critical_Section
VMM_Service End_Crit_And_Suspend
VMM_Service Claim_Critical_Section
VMM_Service Release_Critical_Section
VMM_Service Call_When_Not_Critical
VMM_Service Create_Semaphore
VMM_Service Destroy_Semaphore
VMM_Service Wait_Semaphore
VMM_Service Signal_Semaphore
VMM_Service Get_Crit_Section_Status
VMM_Service Call_When_Task_Switched
VMM_Service Suspend_VM
VMM_Service Resume_VM
VMM_Service No_Fail_Resume_VM
VMM_Service Nuke_VM
VMM_Service Crash_Cur_VM
VMM_Service Get_Execution_Focus
VMM_Service Set_Execution_Focus
VMM_Service Get_Time_Slice_Priority
VMM_Service Set_Time_Slice_Priority
VMM_Service Get_Time_Slice_Granularity
VMM_Service Set_Time_Slice_Granularity
VMM_Service Get_Time_Slice_Info
VMM_Service Adjust_Execution_Time
VMM_Service Release_Time_Slice
VMM_Service Wake_Up_VM
VMM_Service Call_When_Idle
VMM_Service Get_Next_VM_Handle
;
; Time-out and system timer services
;
VMM_Service Set_Global_Time_Out
VMM_Service Set_VM_Time_Out
VMM_Service Cancel_Time_Out
VMM_Service Get_System_Time
VMM_Service Get_VM_Exec_Time
VMM_Service Hook_V86_Int_Chain
VMM_Service Get_V86_Int_Vector
VMM_Service Set_V86_Int_Vector
VMM_Service Get_PM_Int_Vector
VMM_Service Set_PM_Int_Vector
VMM_Service Simulate_Int
VMM_Service Simulate_Iret
VMM_Service Simulate_Far_Call
VMM_Service Simulate_Far_Jmp
VMM_Service Simulate_Far_Ret
VMM_Service Simulate_Far_Ret_N
VMM_Service Build_Int_Stack_Frame
VMM_Service Simulate_Push
VMM_Service Simulate_Pop
;
; Heap Manager
;
VMM_Service _HeapAllocate
VMM_Service _HeapReAllocate
VMM_Service _HeapFree
VMM_Service _HeapGetSize
; ---------------------------------------------------
;
; Flags for heap allocator calls
;
; ---------------------------------------------------
HeapZeroInit equ 00000000000000000000000000000001B
HeapZeroReInit equ 00000000000000000000000000000010B
HeapNoCopy equ 00000000000000000000000000000100B
; NOTE: HIGH 8 BITS (bits 24-31) are reserved
;
; Page Manager
;
VMM_Service _PageAllocate
VMM_Service _PageReAllocate
VMM_Service _PageFree
VMM_Service _PageLock
VMM_Service _PageUnLock
VMM_Service _PageGetSizeAddr
VMM_Service _PageGetAllocInfo
VMM_Service _GetFreePageCount
VMM_Service _GetSysPageCount
VMM_Service _GetVMPgCount
VMM_Service _MapIntoV86
VMM_Service _PhysIntoV86
VMM_Service _TestGlobalV86Mem
VMM_Service _ModifyPageBits
VMM_Service _CopyPageTable
VMM_Service _LinMapIntoV86
VMM_Service _LinPageLock
VMM_Service _LinPageUnLock
VMM_Service _SetResetV86Pageable
VMM_Service _GetV86PageableArray
VMM_Service _PageCheckLinRange
VMM_Service _PageOutDirtyPages
VMM_Service _PageDiscardPages
; ---------------------------------------------------
;
; Flags for other page allocator calls
;
; ---------------------------------------------------
PageZeroInit equ 00000000000000000000000000000001B
PageUseAlign equ 00000000000000000000000000000010B
PageContig equ 00000000000000000000000000000100B
PageFixed equ 00000000000000000000000000001000B
PageDEBUGNulFault equ 00000000000000000000000000010000B
PageZeroReInit equ 00000000000000000000000000100000B
PageNoCopy equ 00000000000000000000000001000000B
PageLocked equ 00000000000000000000000010000000B
PageLockedIfDP equ 00000000000000000000000100000000B
PageSetV86Pageable equ 00000000000000000000001000000000B
PageClearV86Pageable equ 00000000000000000000010000000000B
PageSetV86IntsLocked equ 00000000000000000000100000000000B
PageClearV86IntsLocked equ 00000000000000000001000000000000B
PageMarkPageOut equ 00000000000000000010000000000000B
PagePDPSetBase equ 00000000000000000100000000000000B
PagePDPClearBase equ 00000000000000001000000000000000B
PageDiscard equ 00000000000000010000000000000000B
PagePDPQueryDirty equ 00000000000000100000000000000000B
;
; New for 3.10
;
PageMapFreePhysReg equ 00000000000001000000000000000000B
; NOTE: HIGH 8 BITS (bits 24-31) are reserved
;
; Informational services
;
VMM_Service _GetNulPageHandle
VMM_Service _GetFirstV86Page
VMM_Service _MapPhysToLinear
VMM_Service _GetAppFlatDSAlias
VMM_Service _SelectorMapFlat
VMM_Service _GetDemandPageInfo
;
; Data structure for _GetDemandPageInfo
;
DemandInfoStruc struc
DILin_Total_Count dd ? ; # pages in linear address space
DIPhys_Count dd ? ; Count of phys pages
DIFree_Count dd ? ; Count of free phys pages
DIUnlock_Count dd ? ; Count of unlocked Phys Pages
DILinear_Base_Addr dd ? ; Base of pageable address space
DILin_Total_Free dd ? ; Total Count of free linear pages
DIReserved dd 10 dup (?) ; Resvd for expansion
DemandInfoStruc ends
VMM_Service _GetSetPageOutCount
;
; Flags bits for _GetSetPageOutCount
;
GSPOC_F_Get equ 00000000000000000000000000000001B
;
; Device VM page manager
;
VMM_Service Hook_V86_Page
VMM_Service _Assign_Device_V86_Pages
VMM_Service _DeAssign_Device_V86_Pages
VMM_Service _Get_Device_V86_Pages_Array
VMM_Service MMGR_SetNULPageAddr
;
; GDT/LDT management
;
VMM_Service _Allocate_GDT_Selector
VMM_Service _Free_GDT_Selector
VMM_Service _Allocate_LDT_Selector
VMM_Service _Free_LDT_Selector
VMM_Service _BuildDescriptorDWORDs
;
; Flag equates for _BuildDescriptorDWORDs
;
BDDExplicitDPL EQU 00000000000000000000000000000001B
;
; Flag equates for _Allocate_LDT_Selector
;
ALDTSpecSel EQU 00000000000000000000000000000001B
VMM_Service _GetDescriptor
VMM_Service _SetDescriptor
VMM_Service _MMGR_Toggle_HMA
;
; Flag equates for _MMGR_Toggle_HMA
;
MMGRHMAPhysical EQU 00000000000000000000000000000001B
MMGRHMAEnable EQU 00000000000000000000000000000010B
MMGRHMADisable EQU 00000000000000000000000000000100B
MMGRHMAQuery EQU 00000000000000000000000000001000B
VMM_Service Get_Fault_Hook_Addrs
VMM_Service Hook_V86_Fault
VMM_Service Hook_PM_Fault
VMM_Service Hook_VMM_Fault
VMM_Service Begin_Nest_V86_Exec
VMM_Service Begin_Nest_Exec
VMM_Service Exec_Int
VMM_Service Resume_Exec
VMM_Service End_Nest_Exec
VMM_Service Allocate_PM_App_CB_Area, VMM_ICODE
VMM_Service Get_Cur_PM_App_CB
VMM_Service Set_V86_Exec_Mode
VMM_Service Set_PM_Exec_Mode
VMM_Service Begin_Use_Locked_PM_Stack
VMM_Service End_Use_Locked_PM_Stack
VMM_Service Save_Client_State
VMM_Service Restore_Client_State
VMM_Service Exec_VxD_Int
VMM_Service Hook_Device_Service
VMM_Service Hook_Device_V86_API
VMM_Service Hook_Device_PM_API
VMM_Service System_Control
;
; I/O and software interrupt hooks
;
VMM_Service Simulate_IO
VMM_Service Install_Mult_IO_Handlers
VMM_Service Install_IO_Handler
VMM_Service Enable_Global_Trapping
VMM_Service Enable_Local_Trapping
VMM_Service Disable_Global_Trapping
VMM_Service Disable_Local_Trapping
;
; Linked List Abstract Data Type Services
;
VMM_Service List_Create
VMM_Service List_Destroy
VMM_Service List_Allocate
VMM_Service List_Attach
VMM_Service List_Attach_Tail
VMM_Service List_Insert
VMM_Service List_Remove
VMM_Service List_Deallocate
VMM_Service List_Get_First
VMM_Service List_Get_Next
VMM_Service List_Remove_First
;
; Flags used by List_Create
;
LF_Async EQU 00000001b
LF_Async_Bit EQU 0
LF_Use_Heap EQU 00000010b
LF_Use_Heap_Bit EQU 1
LF_Alloc_Error EQU 00000100b
LF_Alloc_Error_Bit EQU 2
;==============================================================================
; I N I T I A L I Z A T I O N P R O C E D U R E S
;------------------------------------------------------------------------------
;
; Instance data manager
;
VMM_Service _AddInstanceItem
;
; Data structure for _AddInstanceItem
;
InstDataStruc struc
InstLinkF dd 0 ; RESERVED SET TO 0
InstLinkB dd 0 ; RESERVED SET TO 0
InstLinAddr dd ? ; Linear address of start of block
InstSize dd ? ; Size of block in bytes
InstType dd ? ; Type of block
InstDataStruc ends
;
; Values for InstType
;
INDOS_Field equ 100h ; Bit indicating INDOS switch requirements
ALWAYS_Field equ 200h ; Bit indicating ALWAYS switch requirements
;
; System structure data manager
;
VMM_Service _Allocate_Device_CB_Area, VMM_ICODE
VMM_Service _Allocate_Global_V86_Data_Area, VMM_ICODE
VMM_Service _Allocate_Temp_V86_Data_Area, VMM_ICODE
VMM_Service _Free_Temp_V86_Data_Area, VMM_ICODE
;
; Flag bits for _Allocate_Global_V86_Data_Area
;
GVDAWordAlign EQU 00000000000000000000000000000001B
GVDADWordAlign EQU 00000000000000000000000000000010B
GVDAParaAlign EQU 00000000000000000000000000000100B
GVDAPageAlign EQU 00000000000000000000000000001000B
GVDAInstance EQU 00000000000000000000000100000000B
GVDAZeroInit EQU 00000000000000000000001000000000B
GVDAReclaim EQU 00000000000000000000010000000000B
;
; New for 3.10
;
GVDAInquire EQU 00000000000000000000100000000000B
GVDAHighSysCritOK EQU 00000000000000000001000000000000B
;
; Initialization information calls (win.ini and environment parameters)
;
VMM_Service Get_Profile_Decimal_Int, VMM_ICODE
VMM_Service Convert_Decimal_String, VMM_ICODE
VMM_Service Get_Profile_Fixed_Point, VMM_ICODE
VMM_Service Convert_Fixed_Point_String, VMM_ICODE
VMM_Service Get_Profile_Hex_Int, VMM_ICODE
VMM_Service Convert_Hex_String, VMM_ICODE
VMM_Service Get_Profile_Boolean, VMM_ICODE
VMM_Service Convert_Boolean_String, VMM_ICODE
VMM_Service Get_Profile_String, VMM_ICODE
VMM_Service Get_Next_Profile_String, VMM_ICODE
VMM_Service Get_Environment_String, VMM_ICODE
VMM_Service Get_Exec_Path, VMM_ICODE
VMM_Service Get_Config_Directory, VMM_ICODE
VMM_Service OpenFile, VMM_ICODE
VMM_Service Get_PSP_Segment, VMM_ICODE
VMM_Service GetDOSVectors, VMM_ICODE
VMM_Service Get_Machine_Info
GMIF_80486 EQU 00010000h
GMIF_80486_Bit EQU 10h
GMIF_PCXT EQU 00020000h
GMIF_PCXT_Bit EQU 11h
GMIF_MCA EQU 00040000h
GMIF_MCA_Bit EQU 12h
GMIF_EISA EQU 00080000h
GMIF_EISA_Bit EQU 13h
;
; Following service is not restricted to initialization
;
VMM_Service GetSet_HMA_Info
VMM_Service Set_System_Exit_Code
VMM_Service Fatal_Error_Handler
VMM_Service Fatal_Memory_Error
;
; Called by VTD only
;
VMM_Service Update_System_Clock
;==============================================================================
; D E B U G G I N G E X T E R N S
;==============================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -