本文共 1264 字,大约阅读时间需要 4 分钟。
最近在看《x86_x64体系探索及编程》,在制作可供bochs使用的硬盘镜像时出了一些问题,主要有以下几个:
如书中所说,做了:
dd if=uboot of=hello.img seek=63 count=1 conv=notruncdd if=setup of=hello.img seek=1 count=1 conv=notruncdd if=lib16 of=hello.img seek=20 count=1 conv=notrunc
这里需要说明, dd的if选项为输入, of选项为输出,seek跳过输出的几个单元开始写,一个单元512个字节,count是写的单元数,尤其要注意的是conv选项,邓志的书中并未加conv选项,这导致输出文件被截断,不能保持原本的大小,notrunc的意思就是不要截断。
bochs -f bxrc# 执行上面的语句后需要在terminal中输入c,意为continue,bochs才会继续执行
Boot failed: not a bootable disk.
dd if=c.img of=hello.img seek=0 count=1 conv=notrunc
但是运行
bochs -f bxrc# 执行上面的语句后需要在terminal中输入c,意为continue,bochs才会继续执行
之后仍然出现Boot failed: not a bootable disk.
成功了!!!
1、MBR
2、重新编译
转载地址:http://hcxuz.baihongyu.com/