对于QEMU,我可以对initrd使用-initrd '${images_dir}/rootfs.cpio,也可以将initramfs映像直接传递给QEMU。
但是,如果我使用gem5 fs.py --kernel Image尝试initramfs镜像,它将失败,并显示以下信息:
fatal: Could not load kernel file使用与QEMU能够使用的完全相同的initramfs内核映像。
而且我看不到类似于-initrd的东西。
我使用的唯一方法是用原始的vmlinux向--disk-image传递一个ext2磁盘镜像。
https://www.mail-archive.com/gem5-users@gem5.org/msg15198.html
发布于 2019-01-21 23:51:57
gem5至少在arm和x86上看起来没有实现,因为initrd必须知道如何加载它并通知内核它的位置,而grepping initrd只在下面显示一些ARM命中:
src/arch/arm/linux/atag.hh但它们被注释掉了。
现在,通过DTB chosen节点linux,initrd-start和linux,initrd-end属性将initrd传递给内核似乎很简单,因此实现起来可能非常简单:https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt (以及Gem5现有的DTB自动生成)+重用基础设施将任意字节加载到内存位置:How to preload memory with given raw bytes in gem5 from the command line in addition to the main ELF executable?
Initramfs无法工作,因为gem5只能从原始ELF文件vmlinux引导,并且initramfs镜像只能通过内核构建附加到更最终的镜像类型,如镜像或bzImage,QEMU可以使用它们来引导,另请参阅:https://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vml/482978#482978
编辑:在How to attach multiple disk images in a simulation with gem5 fs.py?中提到的补丁之后,不再需要以下内容。为了进行此测试,我还必须传递gem5 7fa4c946386e7207ad5859e8ade0bbfc14000d91的虚拟磁盘镜像。由于脚本不能很好地处理丢失的--disk-image,您可以只转储一些随机的512字节并使用它们:
dd if=/dev/zero of=dummy.iso bs=512 count=1https://stackoverflow.com/questions/49261801
复制相似问题