在Linux下使用Bochs参考:
http://wangcong.org/articles/bochs.html
http://kinglaw05.blog.163.com/blog/static/59683314200911205510345/
首先,安装libgtk2.0-dev,build-essential库
1: sudo apt-get install libgtk2.0-dev build-essential
然后下载最新的bochs源码,解压
1: sudo wget http://bochs.sourceforge.net/svn-snapshot/bochs-20140211.tar.gz
2: sudo gzip -d bochs-20140211.tar.gz
3: sudo tar -xvf bochs-20140211.tar
4: cd bobochs-20140211
配置
将.conf.linux修改成下面模样:
1: #!/bin/sh
2: #
3: # .conf.linux
4: #
5:
6: #which_config=normal
7: which_config=plugins
8:
9: CC="gcc"
10: CXX="c++"
11: CFLAGS="-Wall -O3 -fomit-frame-pointer -pipe" # for speed
12: #CFLAGS="-Wall -g -pipe" # for development
13: CXXFLAGS="$CFLAGS"
14:
15: export CC
16: export CXX
17: export CFLAGS
18: export CXXFLAGS
19:
20:
21: case $which_config in
22:
23: normal)
24:
25: #######################################################################
26: # configuration 1 for release binary RPMs
27: # Include a few standard options, speed optimizations, X11 only.
28: #######################################################################
29: ./configure --enable-sb16 \
30: --enable-ne2000 \
31: --enable-all-optimizations \
32: --enable-cpu-level=6 \
33: --enable-x86-64 \
34: --enable-vmx=2 \
35: --enable-pci \
36: --enable-clgd54xx \
37: --enable-voodoo \
38: --enable-usb \
39: --enable-usb-ohci \
40: --enable-es1370 \
41: --enable-e1000 \
42: --enable-show-ips \
43: --enable-debugger \
44: --enable-disasm
45: ${CONFIGURE_ARGS}
46: ;;
47:
48: plugins)
49: #######################################################################
50: # configuration 2 for release binary RPMs
51: # Include plugins, every possible gui.
52: #######################################################################
53: ./configure --enable-sb16 \
54: --enable-ne2000 \
55: --enable-all-optimizations \
56: --enable-cpu-level=6 \
57: --enable-x86-64 \
58: --enable-vmx=2 \
59: --enable-pci \
60: --enable-clgd54xx \
61: --enable-voodoo \
62: --enable-usb \
63: --enable-usb-ohci \
64: --enable-usb-xhci \
65: --enable-es1370 \
66: --enable-e1000 \
67: --enable-plugins \
68: --enable-show-ips \
69: --with-all-libs \
70: --enable-debugger \
71: --enable-disasm
72: ${CONFIGURE_ARGS}
73: ;;
74:
75: esac
安装
1: sudo make
2: sudo make install
到http://bochs.sourceforge.net/diskimages.html,下载一个已经配置好的img.
1: sudo wget http://bochs.sourceforge.net/guestos/dlxlinux4.tar.gz
2: sudo gzip -d dlxlinux4.tar.gz
3: sudo tar -xvf dlxlinux4.tar
4: cd dlxlinux4
5: bochs -q -f bochsrc.txt
就进入了调试状态
1: daniel@ubuntu:~/linux-3.0/bochs/dlxlinux$ bochs -q -f dlxlinux.bxrc
2: ========================================================================
3: Bochs x86 Emulator 2.6.2.svn
4: Built from SVN snapshot after release 2.6.2
5: Compiled on Feb 14 2014 at 01:21:35
6: ========================================================================
7: 00000000000i[ ] LTDL_LIBRARY_PATH not set. using compile time default ‘/usr/local/lib/bochs/plugins‘
8: 00000000000i[ ] BXSHARE not set. using compile time default ‘/usr/local/share/bochs‘
9: 00000000000i[ ] lt_dlhandle is 0xa956340
10: 00000000000i[PLUGIN] loaded plugin libbx_unmapped.so
11: 00000000000i[ ] lt_dlhandle is 0xa9569d0
12: 00000000000i[PLUGIN] loaded plugin libbx_biosdev.so
13: 00000000000i[ ] lt_dlhandle is 0xa956fb0
14: 00000000000i[PLUGIN] loaded plugin libbx_speaker.so
15: 00000000000i[ ] lt_dlhandle is 0xa9577d8
16: 00000000000i[PLUGIN] loaded plugin libbx_extfpuirq.so
17: 00000000000i[ ] lt_dlhandle is 0xa957d28
18: 00000000000i[PLUGIN] loaded plugin libbx_parallel.so
19: 00000000000i[ ] lt_dlhandle is 0xa959160
20: 00000000000i[PLUGIN] loaded plugin libbx_serial.so
21: 00000000000i[ ] lt_dlhandle is 0xa95c400
22: 00000000000i[PLUGIN] loaded plugin libbx_gameport.so
23: 00000000000i[ ] lt_dlhandle is 0xa95c9b8
24: 00000000000i[PLUGIN] loaded plugin libbx_iodebug.so
25: 00000000000i[ ] reading configuration from dlxlinux.bxrc
26: 00000000000i[ ] lt_dlhandle is 0xa95cf28
27: 00000000000i[PLUGIN] loaded plugin libbx_x.so
28: 00000000000i[ ] installing x module as the Bochs GUI
29: 00000000000i[ ] using log file bochsout.txt
30: Next at t=0
31: (0) [0x0000fffffff0] f000:fff0 (unk. ctxt): jmpf 0xf000:e05b ; ea5be000f0
32: <bochs:1> ^C
按下Ctrl+Z可以退出调试程序
原文:http://www.cnblogs.com/long123king/p/3549701.html