首页 文章

在qemu中加载ROM引导加载程序

提问于
浏览
2

我有一个自定义引导程序,我有引导程序的入口点,如何指定这个地址到qemu?

当我尝试使用此行加载图像时,我也有此警告 qemu-system-mips -pflash img_

WARNING: Image format was not specified for 'img_' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.

我试过 -pflash=img_,format=raw 但它没有用 .

谢谢 .

1 回答

  • 0

    您应该在qemu sources中进行一些挖掘,以便在qemu中使用自定义引导程序映像 . QEMU在board initilizaton函数中加载booloader,这是特定于板的 .

    运行以下命令以查看所有可用的MIPS板型号:

    qemu-system-mips64 -machine  ?
    Supported machines are:
    magnum               MIPS Magnum
    malta                MIPS Malta Core LV (default)
    mips                 mips r4k platform
    mipssim              MIPS MIPSsim platform
    none                 empty machine
    pica61               Acer Pica 61
    

    此模型在qemu / hw / mips / files中实现 . (寻找* _init功能)

    例如,对于malta board(默认值),它是hw / mips / mips_malta.c . 查看mips_malta_init函数:它构造设备,总线和CPU,注册内存区域并将引导加载程序放入内存 . 似乎你正在寻找FLASH_ADDRESS宏 .

    请注意,这个init函数对QEMU实现的所有板都很常见 . 此外,每个板都有一些参考/数据表文档,QEMU模型应该与它们互补,作为程序员的观点 .

相关问题