操作系统制作(0)bochs使用及img引导启动软盘制作

环境:
virtual-box:版本 6.0.10 r132072 (Qt5.6.2)运行的的ubuntu18.04系统。
nasm汇编器:NASM version 2.13.02

1)安装bochs

sudo apt-get install bochs bochs-x

注意:bochs-x要安装,否则会出现>>PANIC<< dlopen failed for module ‘x’: file not found错误,因为没有xwindows组件,无法显示图像。
在这里插入图片描述
2)img引导启动软盘制作
安装了bochs后,该软件提供一个bximage工具可以制作img文件。
制作步骤如下:
在这里插入图片描述
注意到有一行提示:floppya: image=“boot.img”, status=inserted,这行是用于的bochs配置。
我们创建bochs的配置文件如下:

vim bochsrc.txt
在这里插入代码片
# You many now use double quotes around pathnames, in case
# your pathname includes spaces.

#=======================================================================
# MEGS
#内存16MB
#=======================================================================
megs: 16

#=======================================================================
# ROMIMAGE:
# The ROM BIOS controls what the PC does when it first powers on. 
#BIOS选择BIOS-bochs-latest
#=======================================================================
romimage: file=$BXSHARE/BIOS-bochs-latest 

#=======================================================================
# VGAROMIMAGE
# You now need to load a VGA ROM BIOS into C0000.
#VGABIOS选择VGABIOS-lgpl-latest
#=======================================================================
vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest

#=======================================================================
# FLOPPYA, FLOPPYB:
# Point this to pathname of floppy image file or device
#软盘a选择boot.img,状态为inserted
#=======================================================================
floppya: 1_44="boot.img", status=inserted


#=======================================================================
# BOOT:
#引导启动盘选择a盘
#=======================================================================
boot: a
#boot: c

#=======================================================================
# LOG:
# Give the path of the log file you'd like Bochs debug and misc. 
#log输出选择/dev/null设备,丢弃。log文件输出会很大!!!
#=======================================================================
log: /dev/null
#log: bochsout.txt

#=======================================================================
# VGA_UPDATE_INTERVAL:
#=======================================================================

3)bochs使用方法

bochs -h

可以查看bochs的使用方法,如下:
在这里插入图片描述
其中的

bochs -f bochsrx.txt

就可以指定使用我们的配置文件bochsrx.txt运行一个模拟系统。不过,目前的floppya中的boot.img并没有内容。没有系统可以运行。

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值