Ubuntu18.04 Bochs环境配置问题解决方案

bochs下载安装

官网下载https://sourceforge.net/
linux系统用.tar.gz
安装大体可以看这篇文章:
https://blog.csdn.net/qq_37637619/article/details/89784508
另外,官方文档最重要:
https://bochs.sourceforge.io/doc/docbook/user/bochsrc.html

bochs配置问题解决

问题1及解决

nasm安装失败。大体报错Certificate verification failed: The certificate is NOT trusted.
解决方案:

sudo vim /etc/apt/sources.list

将4个deb https改为deb http,完成整个配置后再改回去。

问题2及解决

./config配置建议在sudo apt-get install xorg-dev后面,如果先编辑./config,在安装xorg-dev,后续各种报错

问题3及解决

任何make: *** No rule to make target ‘dir/name.cc’, needed by ‘dir/name.o’. Stop.报错,执行下面语句即可。记得dir和name与报错一致。

cp dir/name.cpp dir/name.cc

问题4及解决

另外就是cp后的cpp文件可能在make install报错,只需要将对应的include“xxx.h”修改为“…/xxx.h”,既可通过。

问题5及解决

记得下面这个.不要忘了

bochs -f .bochsrc

如果报错sound的配置,就vim找到sound对应的行,注释掉即可。

问题6及解决

Bochs is exiting with the following message:
[HD    ] ata0-0: could not open hard drive image file '/hd60M.img'

查了很久,找不到自己想要的,到官方文档以后,发现了自己的问题:https://bochs.sourceforge.io/doc/docbook/user/bochsrc.html#BOCHSOPT-ATA
最后发现以下两种写法是可以使用bochs -f .bochsrc的。

ata0-master:type=disk,path="./hd60M.img",mode=flat,cylinders=121,heads=16,spt=63
ata0-master:type=disk,path="hd60M.img,mode=flat,cylinders=121,heads=16,spt=63

至此,调试成功。
当然,如果碰到.bochsrc哪一行不能识别,vim进去注释掉即可。


版权声明:本文为lzzry1314原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。