ubuntu bochs 编译安装及可能出现的错误的解决办法

来源:互联网 发布:淘宝实物网店怎么刷 编辑:程序博客网 时间:2024/04/27 07:15

 

bochs的安装方法

 

bochs-2.4.1下载地址:
http://sourceforge.net/projects/bochs/files/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

 

 

可能出现的错误:

--checking for C compiler default output file name… configure: error: C compiler cannot create executables
        解决方法: apt-get install libc6-dev
--configure: error: C++ preprocessor "/lib/cpp" fails sanity check
        解决方法:apt-get install build-essential
-- X windows gui was selected, but X windows libraries were not found.
       解决方法:参照04年课程论坛上的解决方法,配置的时候加上--with-nogui(不过后来试了,改成apt-get install xorg-dev也行 )
──make: ***[install_bin] 错误 1
        解决方法:其实很简单,在老师给的讲义那个命令前加上sudo就行,就是sudo make install

 

本文根据http://blog.chinaunix.net/u3/95743/showart_2056874.html

http://hi.baidu.com/mashimarro/blog/item/4b9c3759eb7c4e2e2934f069.html

整理

谢谢原作者!

原创粉丝点击