sudo apt-get install build-essential bison gnome-core-devel checkinstall
解压并开始编译
tar -vxzf bochs-2.4.1.tar.gz
cd bochs-2.4.1
./configure --enable-debugger --enable-disasm
make
如果出现如下错误,
proc_ctrl.cc:654: 错误: ‘CheckPDPTR’在此作用域中尚未声明
proc_ctrl.cc:668: 错误: ‘CheckPDPTR’在此作用域中尚未声明
make[1]: *** [proc_ctrl.o] 错误 1
make[1]:正在离开目录 `/home/manbuzhe/bochs-2.4.1/cpu'
make: *** [cpu/libcpu.a] 错误 2
解决方法:
将 .../bochs-2.4.1/cpu/ 目录下proc_ctrl.cc 文件第650行到第683行替换为如下内容
-------------------------------------------------------------------------------------------------------------------------------------
#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);
}
}
-------------------------------------------------------------------------------------------------------------------------------------
原文出处:http://forum.ubuntu.org.cn/viewtopic.php?t=210457
cd bochs-2.4.1
./configure --enable-debugger --enable-disasm
make && sudo checkinstall
其余部分略!