Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

qemu emulation problems #41

Open
IvanVnucec opened this issue Aug 20, 2021 · 2 comments
Open

qemu emulation problems #41

IvanVnucec opened this issue Aug 20, 2021 · 2 comments

Comments

@IvanVnucec
Copy link

IvanVnucec commented Aug 20, 2021

I'm following the tutorial and had stumbled on this error

qemu-system-riscv64: -drive file=busybox,format=raw,id=hd0: A regular file was expected by the 'file' driver, but something else was given

when running QEMU as:

sudo qemu-system-riscv64 -nographic -machine virt \
     -kernel linux/arch/riscv/boot/Image -append "root=/dev/vda ro console=ttyS0" \
     -drive file=busybox,format=raw,id=hd0 \
     -device virtio-blk-device,drive=hd0

Next I've modified the 'file' to be busybox/busybox because in busybox folder I have built busybox as stated in the tutorial.
Then I get new warnings:

qemu-system-riscv64: warning: No -bios option specified. Not loading a firmware.
qemu-system-riscv64: warning: This default will change in a future QEMU release. Please use the -bios option to avoid breakages when this happens.
qemu-system-riscv64: warning: See QEMU's deprecation documentation for details.

And the QEMU just hangs.

I've also built the QEMU as stated in the guide.

QEMU version:

$ qemu-system-riscv64 --version
QEMU emulator version 5.0.0 (v5.0.0-dirty)
Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers

Ubuntu version:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.5 LTS
Release:	18.04
Codename:	bionic
@louyshong
Copy link

I think there are two issues here. Firstly, add -bios default when running QEMU and the warning should disappear. Then, a kernel panic saying Unable to mount root fs will probably pop up and you will have to prepare a root filesystem to resolve that. A good tutorial can be found here: https://ibug.io/blog/2019/04/os-lab-1/

@dnlombard
Copy link

As indicated above, the qemu execution line is incorrect and will not work as documented. The '-drive' option must specify a root filesystem image, which Busybox does not produce.

The page should be fixed, e.g., by adding steps to create a root filesystem. At the very least, the page should clearly indicate it's not valid and should not be used.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants