[ 3.202055] ALSA device list: [ 3.202573] No soundcards found. [ 3.261558] VFS: Cannot open root device "vda" or unknown-block(0,0): error -6 [ 3.262418] Please append a correct "root=" boot option; here are the available partitions: [ 3.263855] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 3.265404] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.24 #4 [ 3.266257] Hardware name: riscv-virtio,qemu (DT) [ 3.267017] Call Trace: [ 3.267820] [<ffffffff8000586c>] dump_backtrace+0x30/0x38 [ 3.268571] [<ffffffff80b00006>] show_stack+0x40/0x4c [ 3.269168] [<ffffffff80b0743e>] dump_stack_lvl+0x44/0x5c [ 3.269771] [<ffffffff80b0746e>] dump_stack+0x18/0x20 [ 3.270339] [<ffffffff80b001a6>] panic+0x100/0x2c0 [ 3.270938] [<ffffffff80c01672>] mount_block_root+0x14a/0x21c [ 3.271582] [<ffffffff80c01920>] mount_root+0x1dc/0x1f6 [ 3.272164] [<ffffffff80c01a9c>] prepare_namespace+0x162/0x1a4 [ 3.272807] [<ffffffff80c011b8>] kernel_init_freeable+0x220/0x23c [ 3.273489] [<ffffffff80b0e470>] kernel_init+0x32/0x150 [ 3.274067] [<ffffffff800037cc>] ret_from_exception+0x0/0xc [ 3.276155] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) ]--- QEMU: Terminated start.init.sh: line 5: -initrd: command not found
添加配置
root@ubuntu:~/linux-5.15.24# cat .config | grep CONFIG_BLK_DEV_RAM CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 root@ubuntu:~/linux-5.15.24#
qemu-system-riscv64 -nographic -machine virt -bios fw_jump.elf -m 1024 \ -kernel /root/linux-5.15.24/arch/riscv/boot/Image -append "root=0100 ro console=ttyS0,115200n8 earlycon" \ -device virtio-net-device,netdev=eth0 -netdev user,id=eth0,hostfwd=tcp::19999-:22 \ -initrd initramfs.cpio.gz
主机侧
root@ubuntu:~/linux-5.15.24# telnet localhost 19999 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. SSH-2.0-dropbear_2018.76 |&
采用cadence网卡
root@ubuntu:/share# tunctl -t qtap -u $(whoami) Set 'qtap' persistent and owned by uid 0 root@ubuntu:/share# ip link set dev qtap up root@ubuntu:/share# ip addr add 169.254.1.1/16 dev qtap root@ubuntu:/share# ip addr show qtap 34: qtap: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000 link/ether 8e:78:b2:44:1b:5b brd ff:ff:ff:ff:ff:ff inet 169.254.1.1/16 scope global qtap valid_lft forever preferred_lft forever
qemu-system-riscv64 -nographic -machine microchip-icicle-kit -bios fw_jump.elf -m 2048 \ -kernel /root/linux-5.15.24/arch/riscv/boot/Image -append "root=0100 ro console=ttyS0,115200n8 earlycon" \ -nic user,model=cadence_gem \ -nic tap,ifname=qtap,model=cadence_gem,script=no \ -initrd initramfs.cpio.gz
/etc/init.d/S10mdev: line 9: can't create /proc/sys/kernel/hotplug: nonexistent directory modprobe: can't change directory to '/lib/modules': No such file or directory Initializing random number generator... [ 17.966117] random: dd: uninitialized urandom read (512 bytes read) done. Starting network: Waiting for interface eth0 to appear............... timeout! run-parts: /etc/network/if-pre-up.d/wait_iface: exit status 1 FAIL Starting dropbear sshd: [ 36.056310] random: dropbear: uninitialized urandom read (32 bytes read) OK Welcome to Buildroot buildroot login: root Password: # ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: sit0@NONE: <NOARP> mtu 1480 qdisc noop qlen 1000 link/sit 0.0.0.0 brd 0.0.0.0 #