bochs-2.4.1下载地址:
安装bochs-2.4.1前要安装 libgtk2.0-dev和xorg-dev
sudo apt-get install libgtk2.0-dev xorg-dev
解压bochs-2.4.1之后,把/bochs-2.4.1/cpu/proc_ctrl.cc中650行到683行的内容代码成以下代码:
650行开始
#if BX_SUPPORT_VMX
VMexit_CR3_Write(i, val_32);
if (BX_CPU_THIS_PTR cr0.get_PG() && BX_CPU_THIS_PTR cr4.get_PAE() &&
!long_mode()) {
if (! CheckPDPTR(val_32)) {
BX_ERROR(("SetCR3(): PDPTR check failed !"));
exception(BX_GP_EXCEPTION, 0, 0);
}
}
SetCR3(val_32);
BX_INSTR_TLB_CNTRL(BX_CPU_ID, BX_INSTR_MOV_CR3, val_32);
break;
#endif
#if BX_CPU_LEVEL > 3
case 4: // CR4
#if BX_SUPPORT_VMX
val_32 = VMexit_CR4_Write(i, val_32);
if (BX_CPU_THIS_PTR cr0.get_PG() && (val_32 & (1<<5)) != 0 /* PAE */
&& !long_mode()) {
if (! CheckPDPTR(BX_CPU_THIS_PTR cr3)) {
BX_ERROR(("SetCR4(): PDPTR check failed !"));
exception(BX_GP_EXCEPTION, 0, 0);
}
}
// Protected mode: #GP(0) if attempt to write a 1 to
// any reserved bit of CR4
if (! SetCR4(val_32))
exception(BX_GP_EXCEPTION, 0, 0);
break;
#endif
#endif
default:
BX_ERROR(("MOV_CdRd: #UD - control register %d index out of range",
i->nnn()));
exception(BX_UD_EXCEPTION, 0, 0);
}
}
683结束
输入以下命令:
./configure --enable-debugger --enable-disasm
sudo make
sudo make install
阅读(2858) | 评论(0) | 转发(0) |