当同时给出 BIOS 选项时,qemu Arm 中的内核映射地址是多少
我正在尝试使用裸机 BIOS 和内核在 qemu 中制作一个裸机 Arm 操作系统。
当我尝试 qemu-system-arm -machine virt -bios boot.bin -ngraphic boot.bin 被映射到 0x00 时,当我尝试 qemu-system-arm -machine virt -kernel kernel 时.bin kernel.bin 被映射到 0x40010000。
因此,当我执行 qemu-system-arm -machine virt -bios boot.bin -kernel kernel.bin
boot.bin 时,boot.bin 会映射到 0x00,但我找不到 kernel.bin。我尝试检查 0x40000000 但也有一些垃圾值(可能不是垃圾,但它不是 kernel.bin)
我没有找到任何文档说明这一点,如果我使用 -drive< /code> 选项我该如何继续?就像我是否需要编写一个驱动程序来访问驱动器(如果是),我在哪里可以看到文档或可以指导的内容
I am trying to make a baremetal arm os in qemu with baremetal bios as well as kernel.
When I try qemu-system-arm -machine virt -bios boot.bin -nographic
boot.bin gets mapped to 0x00 and when i try qemu-system-arm -machine virt -kernel kernel.bin
kernel.bin gets mapped to 0x40010000.
So when I do qemu-system-arm -machine virt -bios boot.bin -kernel kernel.bin
boot.bin gets mapped to 0x00 but i don't find kernel.bin. I tried to check at 0x40000000 but there also some garbage value is there(might not be garbage but it is not kernel.bin)
I don't find any documentation telling about this, also if I were to use -drive
option how can I go forward on this? like Do i need to write a driver for accessing the drive if yes where can I see documentation or something which can guide
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 -bios 将固件映像传递到“virt”板,那么 QEMU 会将内核映像(以及任何 initrd)放入“fw-cfg”设备中。然后,BIOS 映像中的来宾代码可以访问 fw-cfg 设备,告诉它通过 DMA 将内核映像传送到它喜欢的任何地址。 (此功能主要是为 UEFI BIOS 提供的,当然,如果愿意,任何来宾代码都可以使用 fw-cfg 设备。)
0x40000000 处的数据是设备树 blob,这是您的 BIOS 映像应该按顺序读取的内容找出所有硬件设备在地址映射中的位置。 (这部分记录在 https://www. qemu.org/docs/master/system/arm/virt.html)
请注意,“-kernel”的意思是“我是一个 Linux 内核,以任何看起来最合适的方式加载我”。如果您不希望这样,而只想“在我指定的地址加载二进制图像”,请查看“通用加载器”设备。
If you pass a firmware image to the 'virt' board using -bios then QEMU will put the kernel image (and any initrd) in the 'fw-cfg' device. Guest code in the bios image can then access the fw-cfg device to tell it to DMA the kernel image to whatever address it likes. (This facility is provided primarily for the UEFI BIOS, though of course any guest code can use the fw-cfg device if it likes.)
The data at 0x40000000 is the device tree blob, which is what your bios image should be reading in order to find out where in the address map all the hardware devices are. (This part is documented, at the bottom of https://www.qemu.org/docs/master/system/arm/virt.html)
Note that '-kernel' means "I am a Linux kernel, load me in whatever seems the most appropriate way". If you didn't want that, and just wanted "load a binary image at the address I specify", have a look at the "generic loader" device instead.