yifengyou / The-design-and-implementation-of-a-64-bit-os

《一个64位操作系统的设计与实现》读书笔记&随书源码
1.16k stars 233 forks source link

code/c03/3 没法把loader.bin文件加入到boot.img中 #11

Open gxt-kt opened 1 year ago

gxt-kt commented 1 year ago

在同目录下的run.sh中,使用

mount -t vfat -o loop boot.img tmp/
cp loader.bin tmp/
sync
umount tmp/

将loader.bin文件加入到boot.img中 但是在实际操作中,会在cp那句话报错:没有足够空间。 暂时还没找到原因,我的mount和cp都是使用sudo做的。 请问有人有碰到相同问题吗。

yifengyou commented 1 year ago

可以制作boot.img的时候稍大一点容量,亦或是缩减loader.bin的大小

gxt-kt commented 1 year ago

可以制作boot.img的时候稍大一点容量,亦或是缩减loader.bin的大小

已解决: 解决方法:把img文件做大一点

truncate boot.img -s 1M

如果有小伙伴碰到类似问题可以参考: https://superuser.com/questions/1512423/the-working-of-the-mount-command-and-the-fat12-filesystem