完全安装Bochs2.3.7

安装:

sudo apt-get install bochs bochs-x

调用命令:

bochs -f bochsrc

bochsrc文件要点:

1.指定BIOS镜像

romimage: file=/usr/share/bochs/BIOS-bochs-latest

2.指定显卡镜像

vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest

3.指定内存大小

megs: 16

4.指定软盘镜像

floppya: 1_44="Image", status=inserted

5.指定启动盘

boot: a

6.指定远程调试

gdbstub: enabled=1, port = 1234, text_base=0, data_base=0, bss_base=0

7.其它(略)

常见问题小结

1.>>PANIC<<dlopen failed for module ‘x':file not found

  1. miracle@sunshine:~/study/oldlinux/linux-0.11-devel-060625$ bochs -qf bochsrc-hd.bxrc  
  2. 00000000000i[APIC?] local apic in  initializing   
  3. ========================================================================  
  4.                        Bochs x86 Emulator 2.3.7  
  5.                Build from CVS snapshot, on June 3, 2008   
  6. ========================================================================  
  7. 00000000000i[     ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/lib/bochs/plugins'  
  8. 00000000000i[     ] BXSHARE not set. using compile time default '/usr/share/bochs'  
  9. 00000000000i[     ] reading configuration from bochsrc-hd.bxrc  
  10. 00000000000e[     ] bochsrc-hd.bxrc:194: unknown parameter for parport1 ignored.  
  11. 00000000000e[     ] bochsrc-hd.bxrc:306: ips directive is DEPRECATED (use cpu directive parameter 'ips').  
  12. 00000000000i[     ] lt_dlhandle is (nil)  
  13. 00000000000p[     ] > > PANIC < <   dlopen  failed for module 'x': file not  found   
  14. ========================================================================  
  15. Event type: PANIC  
  16. Device: [     ]  
  17. Message: dlopen failed for module 'x': file not found  
  18. A PANIC has occurred.  Do you want to:  
  19.   cont       - continue execution  
  20.   alwayscont - continue execution, and don't ask again.  
  21.                This affects only PANIC events from device [     ]  
  22.   die        - stop execution now  
  23.   abort      - dump core   
  24.   debug      - hand control to gdb  
  25. Choose one of the actions above: [die]   
  26. 00000000000i[CTRL ] quit_sim called with exit code 1  

这个问题需要通过安装gtk2.0的库文件(具体是什么没考证:))

sudo apt-get install libgtk2.0-dev

2.Message: ROM: System BIOS must end at 0xfffff

  1. miracle@sunshine:~/study/oldlinux/linux-0.11-devel-060625$ bochs -qf bochsrc-hd.bxrc  
  2. 00000000000i[APIC?] local apic in  initializing   
  3. ========================================================================  
  4.                        Bochs x86 Emulator 2.3.7  
  5.                Build from CVS snapshot, on June 3, 2008   
  6. ========================================================================  
  7. 00000000000i[     ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/lib/bochs/plugins'  
  8. 00000000000i[     ] BXSHARE not set. using compile time default '/usr/share/bochs'  
  9. 00000000000i[     ] reading configuration from bochsrc-hd.bxrc  
  10. 00000000000e[     ] bochsrc-hd.bxrc:194: unknown parameter for parport1 ignored.  
  11. 00000000000e[     ] bochsrc-hd.bxrc:306: ips directive is DEPRECATED (use cpu directive parameter 'ips').  
  12. 00000000000i[     ] lt_dlhandle is 0x99bd928  
  13. 00000000000i[PLGIN] loaded plugin libbx_x.la  
  14. 00000000000i[     ] installing x module as the Bochs GUI  
  15. 00000000000i[     ] using log file bochsout.txt   
  16. ========================================================================  
  17. Event type: PANIC  
  18. Device: [MEM0 ]  
  19. Message: ROM: System BIOS must end at 0xfffff  
  20. A PANIC has occurred.  Do you want to:  
  21.   cont       - continue execution  
  22.   alwayscont - continue execution, and don't ask again.  
  23.                This affects only PANIC events from device [MEM0 ]  
  24.   die        - stop execution now  
  25.   abort      - dump core   
  26.   debug      - hand control to gdb  
  27. Choose one of the actions above: [die] cont  

问题原因:
在2.3.5以前的bochs使用的BIOS-bochs-latest是64k的,那个时候需要加上
romimage: file=BIOS-bochs-latest,address=0xf0000
在2.3.5中的BIOS-bochs-latest更新了,变成了128k的,这个时候配置需要改为
romimage: file=$BXSHARE/BIOS-bochs-latest

解决方法:
去掉配置文件中的address那个

3.   directive 'floppy_command_delay' not understood

解决方法:

注掉floppy_command_delay: 50000

参考:

http://forum.ubuntu.org.cn/viewtopic.php?f=65&t=179279&start=0

http://blog.csdn.net/wuyao721/archive/2009/05/13/4178866.aspx

小结:通过apt-get安装bochs固然方便,不过在我学习linux-0.11时,需要跟踪调试内核,则使用bochs debugger版本。

          在有些文章中提到的bochsdbg,实际就是通过配置(./configure --enable-debugger --enable-disasm)编译源代码得到的

          bochs debugger版本后重命令为bochsdbg得到的!

          关于bochsdbg详见《编译安装bochsdbg 2.4》

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值