ubuntu 11.10 x64编译安装bochs2.5.1

来源:岁月联盟 编辑:exp 时间:2012-01-13
众所周知Apt-get安装的bochs是不带调试功能的,必须通过源码编译加上--enable-debugger才行。
 
现在ubuntu源上的bochs版本是2.4.6,但是bochs网站已经发布了2.5.1(http://bochs.sourceforge.net/ ),因此我们直接编译安装bochs2.5.1。
 
 
 
编译源码
从http://bochs.sourceforge.net/ 下载最新的源码并解压
./configure --with-x11 --with-wx --enable-debugger --enable-disasm --enable-all-optimizations --enable-readline --enable-long-phy-address --enable-debugger-gui
如果是64位系统上编译bochs,一定要加上--enable-long-phy-address选项,否则运行中会出现bochs exception(): 3rd (13) exception with no resolution, shutdown status is
make
$cp bochs bochsdbg,编译没有产生bochsdbg,所以这里手动拷贝一份
sudo make install
编译bochs源码报错的处理
checking for C compiler default output file name… configure: error: C compiler cannot create       executables
sudo apt-get install  build-essential libc6-dev
ERROR: X windows gui was selected, but X windows libraries were not found.
sudo apt-get install xorg-dev libgtk2.0-dev
install: cannot stat `./bios/VGABIOS*':
在源码的bios目录下(/xxxx/bochs-2.5.1/bios),建立符号链接ln -s /usr/share/vgabios/vgabios.bin VGABIOS-lgpl-latest
undefined reference to 'XStringToKeysym'
configure时加上--with-x11,--with-x11 --with-wx --enable-debugger --enable-disasm --enable-all-optimizations --enable-readline --enable-long-phy-address --enable-debugger-gui
如果configure时,提示--with-wx有问题,sudo apt-get install libwxgtk2.8-dev libx11-xcb-dev
因为带debug的bochs,每次启动都会打开调试窗口,有时我们只是想看看程序的执行结果,因此源码make install以后,再通过sudo apt-get install bochs安装普通bochs
普通安装的bochs在/usr/bin/bochs,而源码安装的在/usr/local/bin/bochs,/usr/local/bin在PATH中的优先级比/usr/bin高,因此每次执行bochs实际执行的是源码安装的那个,我们可以把/usr/local/bin/bochs重命名。
这样保证我们执行bochs时是普通安装的,执行bochsdbg是源码安装的。
源码安装使用中遇到的问题
(.:7444): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
sudo apt-get install gtk2-engines-pixbuf  解决
使用过程中死机(-_-!)
config_interface和display_library注释掉
或者config_interface = textconfig,display_library=x, options="gui_debug" ,总之别用wx
dlopen failed for module 'x': file not found
sudo apt-get install bochs-x
 
 
bochs2.5.1配置文件的样本是源码目录下的.bochsrc


摘自 如烟海的专栏