dhruvvyas90 / qemu-rpi-kernel

Qemu kernel for emulating Rpi on QEMU
2.04k stars 357 forks source link

Can't run qemu #78

Open cjdg opened 5 years ago

cjdg commented 5 years ago

Iwant to virtualize a sd card which is connected on mmcblk1

this is my command:

sudo qemu-system-arm -M versatilepb -cpu arm1176 -m 256 -drive if=sd,index=1,media=disk -net nic -net user,hostfwd=tcp::5022-:22 -dtb versatile-pb.dtb -kernel kernel-qemu-4.14.79-stretch -append 'root=/dev/sda2 panic=1' -no-reboot -serial stdio

Home directory not accessible: Permission denied pulseaudio: pa_context_connect() failed pulseaudio: Reason: Connection refused pulseaudio: Failed to initialize PA contextaudio: Could not init `pa' audio driver Home directory not accessible: Permission denied Uncompressing Linux... done, booting the kernel. vpb_sic_write: Bad register offset 0x2c Booting Linux on physical CPU 0x0 Linux version 4.14.79 (ubuntu@ip-172-31-22-27) (gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-27ubuntu1~18.04)) #1 Sun Jan 27 22:47:58 UTC 2019 CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d CPU: VIPT aliasing data cache, unknown instruction cache OF: fdt: Machine model: ARM Versatile PB Memory policy: Data cache writeback Built 1 zonelists, mobility grouping on. Total pages: 64960 Kernel command line: root=/dev/sda2 panic=1 PID hash table entries: 1024 (order: 0, 4096 bytes) Dentry cache hash table entries: 32768 (order: 5, 131072 bytes) Inode-cache hash table entries: 16384 (order: 4, 65536 bytes) Memory: 253036K/262144K available (4670K kernel code, 217K rwdata, 1080K rodata, 188K init, 146K bss, 9108K reserved, 0K cma-reserved) Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xffc00000 - 0xfff00000 (3072 kB) vmalloc : 0xd0800000 - 0xff800000 ( 752 MB) lowmem : 0xc0000000 - 0xd0000000 ( 256 MB) modules : 0xbf000000 - 0xc0000000 ( 16 MB) .text : 0xc0008000 - 0xc0497d08 (4672 kB) .init : 0xc05c9000 - 0xc05f8000 ( 188 kB) .data : 0xc05f8000 - 0xc062e420 ( 218 kB) .bss : 0xc0633cf4 - 0xc06585c4 ( 147 kB) NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 VIC @d0800000: id 0x00041190, vendor 0x41 FPGA IRQ chip 0 "intc" @ d0802000, 20 irqs, parent IRQ: 47 clocksource: arm,sp804: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns Failed to initialize '/amba/timer@101e3000': -22 sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns Console: colour dummy device 80x30 console [tty0] enabled Calibrating delay loop... 341.60 BogoMIPS (lpj=1708032) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) Disabling memory control group subsystem CPU: Testing write buffer coherency: ok Setting up static identity map for 0x8220 - 0x827c devtmpfs: initialized random: get_random_u32 called from bucket_table_alloc+0x80/0x1a4 with crng_init=0 VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5 clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns futex hash table entries: 256 (order: -1, 3072 bytes) NET: Registered protocol family 16 DMA: preallocated 256 KiB pool for atomic coherent allocations OF: amba_device_add() failed (-19) for /amba/smc@10100000 OF: amba_device_add() failed (-19) for /amba/mpmc@10110000 OF: amba_device_add() failed (-19) for /amba/sctl@101e0000 OF: amba_device_add() failed (-19) for /amba/watchdog@101e1000 OF: amba_device_add() failed (-19) for /amba/sci@101f0000 OF: amba_device_add() failed (-19) for /amba/ssp@101f4000 OF: amba_device_add() failed (-19) for /amba/fpga/sci@a000 Serial: AMBA PL011 UART driver 101f1000.uart: ttyAMA0 at MMIO 0x101f1000 (irq = 28, base_baud = 0) is a PL011 rev1 console [ttyAMA0] enabled 101f2000.uart: ttyAMA1 at MMIO 0x101f2000 (irq = 29, base_baud = 0) is a PL011 rev1 101f3000.uart: ttyAMA2 at MMIO 0x101f3000 (irq = 30, base_baud = 0) is a PL011 rev1 10009000.uart: ttyAMA3 at MMIO 0x10009000 (irq = 54, base_baud = 0) is a PL011 rev1 vgaarb: loaded SCSI subsystem initialized clocksource: Switched to clocksource arm,sp804 NET: Registered protocol family 2 TCP established hash table entries: 2048 (order: 1, 8192 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes) TCP: Hash tables configured (established 2048 bind 2048) UDP hash table entries: 256 (order: 0, 4096 bytes) UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) NET: Registered protocol family 1 RPC: Registered named UNIX socket transport module. RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. NetWinder Floating Point Emulator V0.97 (double precision) workingset: timestamp_bits=14 max_order=16 bucket_order=2 Installing knfsd (copyright (C) 1996 okir@monad.swb.de). jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc. romfs: ROMFS MTD (C) 2007 Red Hat, Inc. 9p: Installing v9fs 9p2000 file system support Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252) io scheduler noop registered io scheduler deadline registered io scheduler cfq registered (default) io scheduler mq-deadline registered io scheduler kyber registered pl061_gpio 101e4000.gpio: PL061 GPIO chip @0x101e4000 registered pl061_gpio 101e5000.gpio: PL061 GPIO chip @0x101e5000 registered pl061_gpio 101e6000.gpio: PL061 GPIO chip @0x101e6000 registered pl061_gpio 101e7000.gpio: PL061 GPIO chip @0x101e7000 registered OF: PCI: host bridge /amba/pci@10001000 ranges: OF: PCI: IO 0x43000000..0x4300ffff -> 0x00000000 OF: PCI: MEM 0x50000000..0x5fffffff -> 0x50000000 OF: PCI: MEM 0x60000000..0x6fffffff -> 0x60000000 versatile-pci 10001000.pci: PCI core found (slot 11) versatile-pci 10001000.pci: PCI host bridge to bus 0000:00 pci_bus 0000:00: root bus resource [bus 00-ff] pci_bus 0000:00: root bus resource [io 0x0000-0xffff] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff pref] PCI: bus0: Fast back to back transfers disabled pci 0000:00:0c.0: BAR 2: assigned [mem 0x50000000-0x50001fff] pci 0000:00:0c.0: BAR 1: assigned [mem 0x50002000-0x500023ff] pci 0000:00:0c.0: BAR 0: assigned [io 0x1000-0x10ff] clcd-pl11x dev:20: PL110 designer 41 rev0 at 0x10120000 clcd-pl11x dev:20: Versatile hardware, VGA display Console: switching to colour frame buffer device 80x30 brd: module loaded sym53c8xx 0000:00:0c.0: enabling device (0100 -> 0103) sym0: <895a> rev 0x0 at pci 0000:00:0c.0 irq 66 sym0: No NVRAM, ID 7, Fast-40, LVD, parity checking sym0: SCSI BUS has been reset. scsi host0: sym-2.2.3 random: fast init done scsi 0:0:2:0: CD-ROM QEMU QEMU CD-ROM 2.5+ PQ: 0 ANSI: 5 scsi target0:0:2: tagged command queuing enabled, command queue depth 16. scsi target0:0:2: Beginning Domain Validation scsi target0:0:2: Domain Validation skipping write tests scsi target0:0:2: Ending Domain Validation sr 0:0:2:0: [sr0] scsi3-mmc drive: 16x/50x cd/rw xa/form2 cdda tray cdrom: Uniform CD-ROM driver Revision: 3.20 smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre nico@fluxnic.net smc91x 10010000.net eth0: SMC91C11xFD (rev 1) at d0b80000 IRQ 41 smc91x 10010000.net eth0: Ethernet addr: 52:54:00:12:34:56 rtc-ds1307 0-0068: registered as rtc0 IR NEC protocol handler initialized IR RC5(x/sz) protocol handler initialized IR RC6 protocol handler initialized IR JVC protocol handler initialized IR Sony protocol handler initialized IR SANYO protocol handler initialized IR Sharp protocol handler initialized IR MCE Keyboard/mouse protocol handler initialized IR XMP protocol handler initialized versatile reboot driver registered mmci-pl18x fpga:05: /aliases ID not available mmci-pl18x fpga:05: mmc0: PL181 manf 41 rev0 at 0x10005000 irq 59,60 (pio) mmci-pl18x fpga:05: DMA channels RX none, TX none input: AT Raw Set 2 keyboard as /devices/platform/amba/amba:fpga/10006000.kmi/serio0/input/input0 mmci-pl18x fpga:0b: /aliases ID not available mmci-pl18x fpga:0b: mmc1: PL181 manf 41 rev0 at 0x1000b000 irq 49,50 (pio) mmci-pl18x fpga:0b: DMA channels RX none, TX none leds-syscon 10000000.core-module:led@08.0: registered LED versatile:0 leds-syscon 10000000.core-module:led@08.1: registered LED versatile:1 leds-syscon 10000000.core-module:led@08.2: registered LED versatile:2 leds-syscon 10000000.core-module:led@08.3: registered LED versatile:3 leds-syscon 10000000.core-module:led@08.4: registered LED versatile:4 leds-syscon 10000000.core-module:led@08.5: registered LED versatile:5 leds-syscon 10000000.core-module:led@08.6: registered LED versatile:6 leds-syscon 10000000.core-module:led@08.7: registered LED versatile:7 ledtrig-cpu: registered to indicate activity on CPUs Netfilter messages via NETLINK v0.30. nf_conntrack version 0.5.0 (4096 buckets, 16384 max) ip_tables: (C) 2000-2006 Netfilter Core Team NET: Registered protocol family 17 Bridge firewalling registered 9pnet: Installing 9P2000 support rtc-ds1307 0-0068: setting system clock to 2019-06-07 04:23:44 UTC (1559881424) uart-pl011 101f1000.uart: no DMA platform data input: ImExPS/2 Generic Explorer Mouse as /devices/platform/amba/amba:fpga/10007000.kmi/serio1/input/input2 VFS: Cannot open root device "sda2" or unknown-block(0,0): error -6 Please append a correct "root=" boot option; here are the available partitions: 0100 4096 ram0 (driver?) 0101 4096 ram1 (driver?) 0102 4096 ram2 (driver?) 0103 4096 ram3 (driver?) 0104 4096 ram4 (driver?) 0105 4096 ram5 (driver?) 0106 4096 ram6 (driver?) 0107 4096 ram7 (driver?) 0108 4096 ram8 (driver?) 0109 4096 ram9 (driver?) 010a 4096 ram10 (driver?) 010b 4096 ram11 (driver?) 010c 4096 ram12 (driver?) 010d 4096 ram13 (driver?) 010e 4096 ram14 (driver?) 010f 4096 ram15 (driver?) 0b00 1048575 sr0 driver: sr Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.79 #1 Hardware name: ARM-Versatile (Device Tree Support) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (panic+0xb8/0x22c) [] (panic) from [] (mount_block_root+0x1b4/0x2a0) [] (mount_block_root) from [] (mount_root+0xf8/0x124) [] (mount_root) from [] (prepare_namespace+0x160/0x1c4) [] (prepare_namespace) from [] (kernel_init_freeable+0x170/0x1b4) [] (kernel_init_freeable) from [] (kernel_init+0x8/0xf0) [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) Rebooting in 1 seconds..

AdityaGovardhan commented 5 years ago

Three approaches:

1) Try this in -append flag: "rw console=ttyAMA0 root=/dev/sda2 rootfstype=ext4 loglevel=8 rootwait fsck.repair=yes memtest=1"

2) You can try using /dev/mmcblk0p2 instead of /dev/sda2 for root=

3) Have you edited /etc/udev/rules.d/90-qemu.rules as mentioned in https://github.com/dhruvvyas90/qemu-rpi-kernel/wiki?