bochs安装

来源:互联网 发布:lgd官方淘宝店 编辑:程序博客网 时间:2024/05/22 17:57

问题一:

gtk_enh_dbg_osdep.cc:20:21: 致命错误: gtk/gtk.h:没有那个文件或目录

编译中断。

解决方法:

sudo apt-get install libgtk2.0-dev

sudo make dist-clean

sudo ./configure --enable-debugger --enable-disasm

sudo make

cp bochs bochsdbg

sudo make install



参考资料:

bochs安装问题与解决方法:http://m.oschina.net/blog/56095

ar vxzf bochs-2.4.5.tar.gz 
cd bochs-2.4.5
./configure --enable-debugger   --enable-disasm
make 
sudo make install

结果出错,解决的办法是:

问题1: 
   checking for C compiler default output file name… configure: error: C compiler cannot create       executables
   解决办法:
   [thornbird@thornbird bochs-2.4]$ sudo apt-get install libc6-dev 
问题2: 
   ...
   checking how to run the C++ preprocessor... /lib/cpp
   configure: error: C++ preprocessor "/lib/cpp" fails sanity check
   See `config.log' for more details.
   解决方法:
   [thornbird@thornbird bochs-2.4]$ sudo apt-get install build-essential

  问题3: 
   [thornbird@thornbird bochs-2.4]$ make
   make: *** 没有指明目标并且找不到 makefile.停止。
   解决方法:
   [thornbird@thornbird bochs-2.4]$ sudo apt-get install build-essential

   问题4: 
   ...
   checking for wxWidgets library version... 
   checking for default gui on this platform... x11
   ERROR: X windows gui was selected, but X windows libraries were not found.

   解决方法: 配置的时候加上"--with-nogui "
   或者改成:[thornbird@thornbird bochs-2.4]$sudo apt-get install xorg-dev (建议)

问题5:

    Package gtk+-2.0 was not found in the pkg-config search path.Perhaps you should add the directory         containing    `gtk+-2.0.pc'to the PKG_CONFIG_PATH environment variableNo package 'gtk+-2.0' foundERROR:      pkg-config was not found, or unable to access the gtk+-2.0 package.Install pkg-config and      the       gtk+ development package,or disable the gui debugger, or the wxWidgets display library (whichever is    being used).

    解决方法:

    [thornbird@thornbird bochs-2.4]$sudo apt-get install libgtk2.0-dev

  问题6:

    install: 无法获取"./bochsdbg" 的文件状态(stat): 没有该文件或目录

    解决办法:需要在make后,将bochs拷贝一份,命名为bochsdbg

    [thornbird@thornbird bochs-2.4]$ cp bochs bochsdbg



http://hi.baidu.com/zeropointer_/item/57d8d20a38afcb90a3df43d6

sudo apt-get update

sudo apt-get install build-essential

sudo apt-get install xorg-dev



可参考:

http://blog.csdn.net/xiajian2010/article/details/9446465

http://blog.csdn.net/ljl1603/article/details/5873980

安装bochs之前做一些准备工作
sudo apt-get install build-essential
sudo apt-get install xorg-dev
sudo apt-get install bison
一.安装bochs
1. 解包
        tar xvfz bochs-20100502.tar.gz
2.进入bochs-20100502目录
        cd bochs-20100502
3. 配置
        编译两份不同的配置的版本
        第一个的版本为使用bochs自带的内部调试器
        ./configure --prefix=/opt/bochs/debug --enable-plugins --enable-debugger --enable-        disasm
        注释:
              * --prefix=/opt/bochs/debug 软件将被安装到哪个目录下
              * --enable-plugins 是必须要的
              * --enable-debugger 是打开bochs的自带调试器
              * --enbale-disasm 允许反汇编


------------------------------------------
如果configure过程中出现这个问题:
checking for gtk+-2.0 >= 2.0.0... Package gtk+-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gtk+-2.0' found
configure: error: Library requirements (gtk+-2.0 >= 2.0.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.


解决办法为:安装libgtk2.0-dev
sudo apt-get install libgtk2.0-dev
------------------------------------------


4. 编译
        make
5. 安装
        sudo make install
6.加一个符号连接
        sudo ln -s /opt/bochs/debug/
bin/bochs /usr/bin/bochsdbg


第二个版本为使用
gdb-stub的版本

1. 清理
    在配置第二个版本之前,需要把刚才编译的东西清理掉,输入以下
命令
    make clean
2. 配置
    然后配置,配置命令为
    ./configure --prefix=/opt/bochs/gdbstub --enable-plugins --enable-disasm --enable-           gdb-stub
    配置注释:
        * --enable-gdb-stub 打开gdb stub支持
        * 其他选项同上,注意这个不同版本会安装到不同的目录下。
3. 编译
    make
4. 安装
    sudo make install
这样bochs使用外部调试器gdb的版本就编译好了。
5.建一个符号链接
    sudo ln -s /opt/bochs/gdbstub/bin/bochs  /usr/bin/bochs


二. 编译linux 0.11 
内核
linux 0.11源码文件在linux-0.11-081030.tar.gz中,进入目录解压后的目录linux-0.11中
1. 
ubuntu 8.04 gcc 版本为4.2.4,但是GCC4.x 默认检查stack安全,会导致出现__stack_chk_fail错误,所以在编译之前应先修改Makefile:
    linux-0.11/Makefile
    linux-0.11/
kernel/Makefile
    linux-0.11/kernel/chr_dev/Makefile
    linux-0.11/kernel/blk_dev/Makefile
    linux-0.11/fs/Makefile
    在 CFLAGS参数中加入-fno-stack-protector

2. 安装 as86 ld86
    sudo apt-get install bin86 

3.编译 make 
    (编译不成功记得在下次编译前 make clean 一下),如果编译成功则在linux-0.11目录下生成          Image

三. 配置bochs
这是bochs-2.3.5的配置文件
                
                
                romimage: file=$BXSHARE/BIOS-bochs-latest   
megs: 16 
vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest
vga: extension=vbe 
floppya: 1_44="Image", status=inserted 
floppyb: 1_44=diska.img, status=inserted 
ata0-master: type=disk, path="hdc-0.11-new.img", mode=flat,cylinders=410, heads=16, spt=38 
boot: a 
log: bochsout.txt
parport1: enable=0 
vga_update_interval: 300000 
keyboard_serial_delay: 200 
floppy_command_delay: 50000 
ips: 4000000 
mouse: enabled=0 
private_colormap: enabled=0 
fullscreen: enabled=0
screenmode: name="sample"
(注:如果编译内核不成功且只是想启动bochs,看一下linux 0.11 界面的话,可以直接把上述配置的boot:a,改为boot:c)

运行bochs
bochs -f bochsrc.bxrc
注:用gdb 调试时出现“system bios must end at 0xffff”,可把*.bxrc romimage 一行中的address=0f0000 去掉

#romimage: file=$BXSHARE/BIOS-bochs-latest, address=0xf0000
romimage: file=$BXSHARE/BIOS-bochs-latest


附:linux 0.11 http://dipplum.com/linux-0.11-lab/linux-0.11-060618-gcc4.tar.gz
     关于在unbuntu下安装0.11般linux 的参考
                 http://oldlinux.org/oldlinux/viewthread.php?tid=3850&extra=page%3D1
                 http://www.seebit.org/2007/12/compile-linux011-in-ubuntu/

遇到的问题:把#elif 该为#else


0 0
原创粉丝点击