riscv-software-src / riscv-software-src/opensbi
how to pass the command with fw_payload.elf
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.5k
- Forks
- 712
- PR merge metrics
- No merged PRs in 30d
Description
I follows the command to boot linux with fw_payload.elf. With this, I think vmlinux in included in fw_pyaload.elf, so -kernel is not used. but when -kernel is not used, -append is not allowed.
qemu-system-riscv64 -M virt -m 256M -nographic -bios opensbi/build/platform/generic/firmware/fw_payload.elf -drive file=./rootfs.img,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -append "root=/dv/vda rw console=ttyS0"
Without -append, the boot will error out with the following error.
[ 0.272843] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[ 0.273070] Please append a correct "root=" boot option; here are the available partitions:
[ 0.273442] fe00 1048576 vda
[ 0.273466] driver: virtio_blk
[ 0.273773] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 0.274122] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0 #1
[ 0.274310] Call Trace:
[ 0.274468] [<ffffffe000037ac4>] walk_stackframe+0x0/0xa6
[ 0.274625] [<ffffffe000037c3a>] show_stack+0x2a/0x34
[ 0.274793] [<ffffffe000621d4e>] dump_stack+0x6e/0x88
[ 0.274925] [<ffffffe00003cb86>] panic+0xdc/0x246
[ 0.275059] [<ffffffe000000f7a>] mount_block_root+0x184/0x218
[ 0.275189] [<ffffffe00000111c>] mount_root+0x10e/0x124
[ 0.275308] [<ffffffe000001244>] prepare_namespace+0x112/0x15c
[ 0.275438] [<ffffffe000000c10>] kernel_init_freeable+0x188/0x1a4
[ 0.275573] [<ffffffe00063662a>] kernel_init+0x12/0xf0
[ 0.275690] [<ffffffe000036818>] ret_from_exception+0x0/0xc
[ 0.276288] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]---
QEMU: Terminated
How can I pass "root=" to kernel with fw_payload.elf?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the fw_payload.elf boot path and the QEMU command shown in the issue; check how arguments are forwarded when -kernel is omitted. Done means identifying a supported way to pass root= to the kernel, or documenting the limitation and the working boot invocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux
- Domain
- operating-systems
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100