一、虚拟机启动

整个过程比较清晰,2.7的过程会对vmcs的状态域进行设置,也就是会接管中断过程,VMxLaunch启动硬件虚拟化。
再往上,一段汇编。调用HvmSubvertCpu
CmSubvert (PVOID GuestRsp);
CmSubvert PROC StdCall _GuestRsp
CM_SAVE_ALL_NOSEGREGS
mov eax,esp
push eax ;setup esp to argv[0]
call HvmSubvertCpu@4
ret
CmSubvert ENDP
//对当前物理CPU上的所有逻辑CPU,进行虚拟设置,反转到虚拟机的运行状态
NTSTATUS NTAPI HvmSwallowBluepill (
)
{
CCHAR cProcessorNumber;
NTSTATUS Status, CallbackStatus;
_KdPrint (("HvmSwallowBluepill(): Going to subvert %d processor%s\n",
KeNumberProcessors, KeNumberProcessors == 1 ? "" : "s"));
KeWaitForSingleObject (&g_HvmMutex, Executive, KernelMode, FALSE, NULL);
for (cProcessorNumber = 0; cProcessorNumber < KeNumberProcessors; cProcessorNumber++) {
_KdPrint (("HvmSwallowBluepill(): Subver

本文详细解析了NewBluePill驱动程序的工作流程,包括初始化管理器、映射客户机内核页表等步骤,并阐述了如何通过HvmSwallowBluepill函数使操作系统进入虚拟机状态。

271

被折叠的 条评论
为什么被折叠?



