Gem5 ARM FS - 内核崩溃 - 不同步:VFS:无法在未知块 (8,1) 上挂载根 fs

Gem5 ARM FS - Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)

我正在尝试 运行 我在 Gem5 中的第一个全系统模拟,但出现以下错误

[    5.703750] VFS: Cannot open root device "sda1" or unknown-block(8,1): error -6
[    5.704398] Please append a correct "root=" boot option; here are the available partitions:
[    5.706209] 0800             252 sda 
[    5.706370]  driver: sd
[    5.707223] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)
[    5.708000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.0+ #1
[    5.708570] Hardware name: V2P-CA15 (DT)
[    5.709020] Call trace:
[    5.709601]  dump_backtrace+0x0/0x1c0
[    5.710230]  show_stack+0x14/0x20
[    5.710844]  dump_stack+0x8c/0xac
[    5.711375]  panic+0x130/0x288
[    5.711980]  mount_block_root+0x1a8/0x294
[    5.712617]  mount_root+0x140/0x174
[    5.713243]  prepare_namespace+0x138/0x180
[    5.713891]  kernel_init_freeable+0x1c0/0x1e0
[    5.714489]  kernel_init+0x10/0x108
[    5.715069]  ret_from_fork+0x10/0x18
[    5.715584] Kernel Offset: disabled
[    5.716051] CPU features: 0x21c0649a
[    5.716509] Memory Limit: 512 MB
[    5.717254] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1) ]---

gem5 命令的输出是

warn: Tried to write RVIO at offset 0xa8 (data 0) that doesn't exist
warn: Tried to read RealView I/O at offset 0x8 that doesn't exist
warn: Tried to read RealView I/O at offset 0x48 that doesn't exist
warn: EnergyCtrl: Disabled handler, ignoring read from reg 0
info: Dumping kernel dmesg buffer to system.workload.dmesg...
warn: Kernel panic in simulated kernel

我正在使用

内核和磁盘映像取自 gem5 来宾二进制文件 page,我取了第一个 link(最新 Linux 内核映像/引导加载程序)

我注意到this问题,但错误略有不同,运行ning命令行、内核、图像不同。

我该如何解决这个问题?

This answer to the question you mentioned points to: https://askubuntu.com/questions/41930/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block0-0/1048477#1048477 其中包含针对此错误的详细诊断过程。

为此,从内核消息中,我们清楚地看到 root= 内核 CLI 参数不正确:使用了默认的 sda1 而不是所需的 sda.

在 fs.py 上,正确的 root= 可以设置为:

--command-line 'earlyprintk=pl011,0x1c090000 lpj=19988480 rw loglevel=8 mem=256MB root=/dev/sda console_msg_format=syslog nokaslr norandmaps panic=-1 printk.devkmsg=on printk.time=y rw console=ttyAMA0 - lkmc_home=/lkmc'

我认为没有办法在 fs.py 中只设置 root= ,所以所有其他选项都是从默认的 fs.py 内核 CLI 复制的,只是 --root 被修改。这样也可以be seen here.