下载Bochs
找一个Bochs最新的下载就好了
yum install gcc bochs使用c++编写,编译源代码时用到gcc
yum groupinstall "Development Tools"
yum install ncurses-devel zlib-devel texinfo gtk+-devel gtk2-devel qt-devel tcl-devel tk-devel kernel-headers kernel-devel
不然在configure和make时会遇到错误(可以参考http://www.cnblogs.com/dczsf/archive/2011/03/08/1977019.html)
由于centos是面向服务器类型的,所以在使用yum安装某些个图形桌面软件时,显示的是没有,这时可以加入非官方的软件库,比如rpmforge:
下载与安装相应rpmforge的rpm文件包
1,下载rpmforge的rpm文件包
[root@CentOS ~]# wget
2,安装DAG的PGP Key
[root@CentOS ~]# rpm --import
3,验证rpmforge的rpm文件包
[root@CentOS ~]# rpm -K /home/Downloads/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
4,安装rpmforge的rpm文件包
[root@CentOS ~]# rpm -i /homeDownloads/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
5,设置/etc/yum.repos.d/rpmforge.repo文件中源的级别,就是添加priority=12这句。
如我的rpmforge.repo文件内容:
### Name: RPMforge RPM Repository for RHEL 6 - dag
### URL:
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl =
mirrorlist =
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority = 12
当make是出现如下错误时:
当启用bochs 的debugger时,配置./configure --enable-debugger --enable-disasm --with-wx后make就出现下面的错误:
gui/libgui.a(gtk_enh_dbg_osdep.o): In function `MakeGTKthreads()':
/home/bcos/Desktop/bochs-test/bochs-2.4.pre1/gui/gtk_enh_dbg_osdep.cc:2120: undefined reference to `pthread_create'
collect2: ld returned 1 exit status
make: *** [bochs] Error 1
解决方法1:修改"Makefile.in" 92 和 93行 为 "CC = @CC@ -pthread" and "CXX = @CXX@ -pthread"
解决方法2:在Makefile.in中183行(搜索bochs@EXE也可以)
bochs@EXE@: @IODEV_LIB_VAR@ @DEBUGGER_VAR@ \
cpu/libcpu.a memory/libmemory.a gui/libgui.a \
@DISASM_VAR@ @INSTRUMENT_VAR@ $(BX_OBJS) \
$(SIMX86_OBJS) @FPU_VAR@ @GDBSTUB_VAR@ @PLUGIN_VAR@
@LINK@ @EXPORT_DYNAMIC@ $(BX_OBJS) $(SIMX86_OBJS) \
@IODEV_LIB_VAR@ @DEBUGGER_VAR@ cpu/libcpu.a memory/libmemory.a gui/libgui.a \
@DISASM_VAR@ @INSTRUMENT_VAR@ @PLUGIN_VAR@ \
@GDBSTUB_VAR@ @FPU_VAR@ \
@NONPLUGIN_GUI_LINK_OPTS@ \
$(MCH_LINK_FLAGS) \
$(SIMX86_LINK_FLAGS) \
$(READLINE_LIB) \
$(EXTRA_LINK_OPTS) \
$(LIBS)
在最后$(LIBS)后面加上 \ -lpthread如下:
bochs@EXE@: @IODEV_LIB_VAR@ @DEBUGGER_VAR@ \
cpu/libcpu.a memory/libmemory.a gui/libgui.a \
@DISASM_VAR@ @INSTRUMENT_VAR@ $(BX_OBJS) \
.
.
.
$(LIBS)\
-lpthread
注意:Makefile.in就是用于configure来生成Makefile的,所以修改这个文件后,
需要重新执行:./configure --enable-debugger 来生成Makefile,
如果是在configure后修改Makefile.in,然后执行make,这个时候的Makefile还是编译出错。
即可编译通过。
然后sudo make install
然后[root@localhost ~]# gedit bochsrc //编辑 bochs 配置文件,内容如下红色字体
###############################################################
# Configuration file for Bochs
###############################################################
# how much memory the emulated machine will have
megs: 32
# filename of ROM images
romimage: file=/usr/local/share/bochs/BIOS-bochs-latest
vgaromimage: file=/usr/local/share/bochs/VGABIOS-lgpl-latest
# what disk images will be used
# floppya: 1_44=/root/bootimage-0.11-20040305, status=inserted
# floppyb: 1_44=/root/rootimage-0.11-20040305, status=inserted
floppya: 1_44=/root/bootroot-0.11, status=inserted
# choose the boot disk.
boot: a
# where do we send log messages?
log: bochsout.txt
# disable the mouse
mouse: enabled=1
# enable key mapping, using US layout as default.
keyboard_mapping: enabled=1, map=/usr/local/share/bochs/keymaps/x11-pc-us.map
#enabled debug using xchg bx, bx
#magic_break:enabled=1
###########################################################
[root@localhost ~]# bochs -f bochsrc
你的bochs到此就安装完成了。
阅读(2460) | 评论(0) | 转发(0) |