linux下bochs的安装及简单使用

来源:互联网 发布:ip网络报警器 编辑:程序博客网 时间:2024/06/06 02:31
linux下安装bochs:
1:下载bochs-2.3.5
2:tar vxzf bochs-2.3.5.tar.gz
3:cd bochs-2.3.5

4:./configure --enable-debugger --enable-disasm --with-nogui

//我们一般在虚拟机上安装linux,因此可能很多包都没有安装。

//按照本书的思想,我们在windows下编写代码,在linux下编译并debug,最后在windows下查看成果

//因此我选择--with-nogui选项,这样就不会安装图形界面,只能调试,但是已经够用了

5:make
6:make install

至此bochs安装完成


********************************************************************************************************************

创建软盘:bximage
写软盘: dd if boot.bin of=a.img bs=512 count=1 conv=notrunc
配置     .bochsrc   文件(默认情况下,bochs会在当前目录下按照顺序寻找 .bochsrc bochsrc bochsrc.txt)

********************************************************************************************************************

注意:(与课本上的不同)
romimage: file=/usr/local/share/bochs/BIOS-bochs-latest
vgaromimage: file=/usr/local/share/bochs/VGABIOS-lgpl-latest


然后bochs -f bochsrc开始调试:(部分指令)
b 0x7c00:set a breakpoint at 0x7c00
c:let the code execute
s:execute one step
n:execute one step and jump when there is a function
dump_cpu:list the regesiters  
info break :list the information of all breakpoints
info cpu:
r:base information of regesiter
print-stack:
x:list the information of memory physical address or linear address
:use "help x" to list the usage detailed
原创粉丝点击