bochs-2.4.5 using notes

来源:互联网 发布:php 直播间 编辑:程序博客网 时间:2024/05/18 06:50
一、Ubuntu12.04下bochs安装过程:
sudo apt-get install vgabios bochs-x bximage bochs

或者是下载bochs-xxx.tar.gz包
tar -xzf bochs-xxx.tar.gz
cd bochs-xxx
./cofigure –enable-debugger –enable-disasm
make
sudo make install

注意"./configure"之后的参数便是打开调试功能的开关。在安装过程中,如果遇到任何困难,不要惊慌,其官方网站上有详细的安装说明。
出现的常见问题以及解决办法:
(1) 出现
1 “ERROR: X windows gui was selected, but X windows libraries were not found.
解决办法:
 sudo apt-get install libx11-dev xserver-xorg-dev xorg-dev
(2) 出现
1 “ERROR: 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).”
2 ERROR: 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)
解决办法:
sudo apt-get install libgtk2.0-dev
(3)
1 checking for C compiler default output file name… configure: error: C compiler cannot create executables
解决方法:
1 apt-get install libc6-dev
(4)
1 configure: error: C++ preprocessor "/lib/cpp" fails sanity check
解决方法:
1 apt-get install build-essential
(5)
1 X windows gui was selected, but X windows libraries were not found.
解决方法:配置的时候加上–with-nogui(不过后来试了,改成apt-get install xorg-dev也行 )

二、bochs 的调试命令

c|cont|continue - continue executing

s|step [count] - execute #count instructions on current processor (default is one instruction)
s|step [cpu] <count> - execute #count instructions on processor #cpu
s|step all <count> - execute #count instructions on all the processors

n|next|p - execute instruction stepping over subroutines

modebp - toggles mode switch breakpoint

vmexitbp - toggles VMEXIT switch breakpoint

u|disasm [/count] <start> <end> - disassemble instructions for given linear address
    Optional 'count' is the number of disassembled instructions
u|disasm switch-mode - switch between Intel and AT&T disassembler syntax
u|disasm hex on/off - control disasm offsets and displacements format
u|disasm size = n - tell debugger what segment size [16|32|64] to use
       when "disassemble" command is used.

x  /nuf <addr> - examine memory at linear address
xp /nuf <addr> - examine memory at physical address
    nuf is a sequence of numbers (how much values to display)
    and one or more of the [mxduotcsibhwg] format specificators:
    x,d,u,o,t,c,s,i select the format of the output (they stand for
        hex, decimal, unsigned, octal, binary, char, asciiz, instr)
    b,h,w,g select the size of a data element (for byte, half-word,
        word and giant word)
    m selects an alternative output format (memory dump)

三、bochs使用心得

当在工程目录中打开bochs后,如一下画面

然后输入命令

show int

然后接着输入命令

c

你将会看见仿真系统在中断触发时,会显示在当前终端中,方便trace中断的执行情况


0 0
原创粉丝点击