qemuでRaspberry PIビルドルートイメージを実行する

qemuでRaspberry PIビルドルートイメージを実行する

buildrootを使用してraspberrypi3用のLinuxイメージを構築し、それをqemuで実行しようとしています。制作プロセスが完了したら、sdcard.imgファイルをSDカードにコピーし、実際のラズベリーファイデバイスで問題なくOSを正しく実行できました。

ただし、同じイメージファイルを使用してqemuで実行しようとすると、起動は失敗します。

1) qemu-system-aarch64 -M raspi3 -kernel zImage -dtb <generated dtb> -sd <generated .img> => qemu window opens but blank. nothing on the terminal as well.
2) qemu-system-arm -M raspi2 -kernel zImage -dtb <generated dtb> -sd <generated .img> => qemu window opens. raspberry image appears on top left corner. but in the teminal window there is a kernel panic. VFS mount failed
3) same as 1st step but with a freshly compiled qemu from source => same as 1st step. nothing on the qemu window or in the terminal.

私は何が間違っていましたか?

ベストアンサー1

数日間のインターネット検索の最後に私の質問に対する答えを見つけました。ターミナルコマンドで使用されたbuildroot makeプロセスで構築されたカーネルイメージzImageは、QEMUと互換性がありません。この問題を解決するには、QEMU準拠のRaspberry Piカーネルを直接コンパイルする必要がありました。

私は自分のカーネルをコンパイルするためにこのリンクに従いました。Raspberry Piクロスコンパイルカーネル さらに、QEMUを使用してOSを実行したときにVFSのインストールに失敗したという別のカーネルパニックが発生しました。以前にターミナル出力を読んでみるとメディアスペースが足りないと出ていました。したがって、scraped.img ファイルを 1G に拡張し、同じ端末コマンドを実行します。

今QEMUは完全に実行されます。

おすすめ記事