bochs使用方法总结
来源:互联网 发布:哪个租房软件最靠谱 编辑:程序博客网 时间:2024/06/03 17:10
Copyright 2015 张智鹏
ubuntu14.04下bochs安装方法
- 去官网下载bochs2.6.7源代码
- 将其解压到 /usr/local/src
- 进入/usr/local/src/bochs-2.6.7/,输入命令
sudo ./configure –with-x11 –with-wx –enable-debugger –enable-disasm –enable-all-optimizations –enable-readline –enable-long-phy-address –enable-debugger-gui
–enable-debugger:开启调试功能
–enable-disasm:开启反汇编功能
–enable-long-phy-address:如果你是64位的系统,则需要这一句
可能会报错:
ERROR: X windows gui was selected, but X windows libraries were not found.
需要安装xorg-dev, libgtk2.0-dev等库(可能还有其它库,有点忘了)
- 输入命令make
会出现如下错误:
/usr/bin/ld: gui/libgui.a(gtk_enh_dbg_osdep.o): undefined reference to symbol pthread_create@@GLIBC_2.1 //
lib/i386-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld r
解决方法:
在bochs2.6.7目录下的Makefile文件中的LIBS下添加如下内容 :
-lz -lrt -lm -lpthread
bochs配置文件
下面两个文件是bochs的示例配置文件,里面的注释有详细的介绍(这两个文件一模一样)
/usr/local/share/doc/bochs/bochsrc-sample.txt
/usr/local/src/bochs-2.6.7/.bochsrc
也可以使用如下比较简单的配置文件:
{参考自:《Orange S:一个操作系统的实现》}
################################################################ Configuration file for Bochs################################################################ how much memory the emulated machine will havemegs: 32# filename of ROM imagesromimage: file=/usr/share/bochs/BIOS-bochs-latestvgaromimage: file=/usr/share/vgabios/vgabios.bin# what disk images will be used# 使用虚拟软盘floppya: 1_44=a.img, status=inserted# 使用虚拟硬盘# ata0-master: type=disk, path="hd_20_16_63.img", mode=flat, cylinders=20, heads=16, spt=63# choose the boot disk.# 选择虚拟软盘作为启动盘boot: floppy# 使用虚拟硬盘作为启动盘# boot: disk# where do we send log messages?log: bochsout.txt# disable the mousemouse: enabled=0# enable key mapping, using US layout as default.keyboard_mapping: enabled=1, map=/usr/share/bochs/keymaps/x11-pc-us.map
虚拟硬盘生成方法示例(软盘同理):
输入命令:bximage
选择 hd
选择 flat
选择 10m
输入虚拟硬盘映像名称 eg.hd_20_16_63.img
要注意生成的硬盘的cylinders(柱面数),heads(磁头数), spt(每个磁道的扇区数量)
Sectors = Cylinders * Heads * SectorsPerTrack = 20*16*63 (柱面 磁头 磁道 扇区)
Space = Sectors*512bytes
bochs常用调试命令
{参考bochs官网userguide以及 《x86汇编语言-从实模式到保护模式》}
Execution Control
BreakPoints
Manipulating Memory
- n Count of how many units to display
- u Unit size; one of
- b Individual bytes
- h Halfwords (2 bytes)
- w Words (4 bytes)
- g Giant words (8 bytes)
NOTE: these are not typical Intel nomenclature sizes,
but they are consistent with GDB convention.
f Printing format. one of
- x Print in hexadecimal
- d Print in decimal
- u Print in unsigned decimal
- o Print in octal
n, f, and u are optional parameters. u and f default to the last values
you used, or to w(words) and x(hex) if none have been supplied.
n currently defaults to 1. If none of these optional parameters are
used, no slash should be typed. addr is also optional. If you don’t
specify it, it will be the value the next address (as if you had
specified n+1 in the last x command).
Info commands
Instruction tracing
反汇编指令
- bochs使用方法总结
- BOCHS问题总结篇
- Bochs使用总结
- bochs调试命令总结
- Bochs
- Bochs
- bochs
- bochs
- bochs
- bochs
- Bochs调试及相关仿真工具的使用方法
- 《自己动手写操作系统》第二章——Bochs调试及相关仿真工具的使用方法
- [Bochs]Bochs调试技术
- [Bochs]Bochs调试技术
- extern使用方法总结!
- 转载:extern使用方法总结!
- Log4j使用方法总结
- JFreeReport使用方法总结
- 设计模式六大原则(1):单一职责原则
- Android之应用中执行Linux命令
- cookie 存放地点
- FTM模块详细讲解
- form的onsubmit事件--表单提交前的验证最佳实现方式
- bochs使用方法总结
- Jmeter 录制脚本
- 黑马程序员_Java基础_常用工具类
- spring applicationContext.xml 文
- 设计模式六大原则(2):里氏替换原则
- 在Mathematica中如何把手动调整好的最佳视角的数值固定下来?
- PRML-系列一
- Android中PropertyAnimation属性动画详解(一)
- ArcGIS教程:训练样本评估工具