UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Reply

Getting started with Zynq 14.5 and QEMU

Accepted Solution Solved
Visitor
Posts: 1
Registered: ‎04-26-2013
Accepted Solution

Getting started with Zynq 14.5 and QEMU

Hi all,

 

I'm trying to set up a virtual environment that I can use to test software for the ZC706. I don't need anything fancy, just a plain vanilla environment where I can run a C++ "Hello World" program compiled for ARM. I gave QEMU a shot by following the instructions on the wiki but I have not been successful.

 

I think others have had similar trouble:

 

Here is exactly what I have done on a Windows 7 machine:

 

  1. Downloaded and installed VirtualBox 4.2.12. Created a VM with Ubuntu 12.04.2 Desktop 64-bit and 2 GB of memory, and upgraded all packages to latest.

    sudo apt-get update
    sudo apt-get upgrade

  2. Installed QEMU dependencies.

    sudo apt-get install build-essential git-core flex bison libglib2.0-dev libpixman-1-dev zlib1g-dev

  3. Cloned the Xilinx QEMU project into my home directory.
     
    cd
    git clone git://git.xilinx.com/qemu.git
    cd qemu
    git checkout xilinx-master
     
  4. Ubuntu does not appear to support the "DTC devel" package that QEMU requires (I tried installing the device-tree-compiler and libfdt-dev packages, but neither made a difference). So I added the submodule:

    git submodule update --init dtc

  5. Configured and built QEMU (had to limit the number of jobs or else my VM ran out of memory):

    ./configure --target-list="arm-softmmu,microblazeel-softmmu" --enable-fdt --disable-kvm
    make -j4

  6. Obtained and extracted the Zynq 14.5 images:

    cd
    mkdir zynq-14.5

    cd zynq-14.5
    wget http://www.wiki.xilinx.com/file/view/14.5-release.tar.xz/426726708/14.5-release.tar.xz
    tar xvJf 14.5-release.tar.xz

  7. Attempted to start the virtual environment:

    cd
    ./qemu/arm-softmmu/qemu-system-arm -M arm-generic-fdt -nographic -serial mon:stdio -dtb zynq-14.5/zc70x/zc706/devicetree.dtb -kernel zynq-14.5/uImage -initrd zynq-14.5/uramdisk.image.gz -machine linux=on -smp 2

This is where I ran into trouble. The machine did not start, I got the message "No filesystem could mount root."

 

I got the following output:

 

console [ttyPS0] enabled, bootconsole disabled
console [ttyPS0] enabled, bootconsole disabled
xdevcfg f8007000.devcfg: ioremap f8007000 to f0060000 with size 100
: r_unlock_post_write: successful unlock
brd: module loaded
loop: module loaded
xqspips e000d000.spi: master is unqueued, this is deprecated
m25p80 spi1.0: n25q128 (32768 Kbytes)
5 ofpart partitions found on MTD device spi1.0
Creating 5 MTD partitions on "spi1.0":
0x000000000000-0x000000100000 : "qspi-fsbl-uboot"
0x000000100000-0x000000600000 : "qspi-linux"
0x000000600000-0x000000620000 : "qspi-device-tree"
0x000000620000-0x000000c00000 : "qspi-rootfs"
0x000000c00000-0x000002000000 : "qspi-bitstream"
xqspips e000d000.spi: at 0xE000D000 mapped to 0xF0062000, irq=51
e1000e: Intel(R) PRO/1000 Network Driver - 2.1.4-k
e1000e: Copyright(c) 1999 - 2012 Intel Corporation.
libphy: XEMACPS mii bus: probed
xemacps e000b000.eth: invalid address, use assigned
xemacps e000b000.eth: MAC updated a6:03:ef:b9:9d:0c
xemacps e000b000.eth: pdev->id -1, baseaddr 0xe000b000, irq 54
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
xi2cps e0004000.i2c: 100 kHz mmio e0004000 irq 57
i2c i2c-0: Added multiplexed i2c bus 1
i2c i2c-0: Added multiplexed i2c bus 2
i2c i2c-0: Added multiplexed i2c bus 3
at24 3-0054: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
i2c i2c-0: Added multiplexed i2c bus 4
i2c i2c-0: Added multiplexed i2c bus 5
i2c i2c-0: Added multiplexed i2c bus 6
i2c i2c-0: Added multiplexed i2c bus 7
i2c i2c-0: Added multiplexed i2c bus 8
pca954x 0-0074: registered 8 multiplexed busses for I2C switch pca9548
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0
Registering SWP/SWPB emulation handler
dmatest: Started 1 threads using dma0chan0
dmatest: Started 1 threads using dma0chan1
dmatest: Started 1 threads using dma0chan2
dmatest: Started 1 threads using dma0chan3
dmatest: Started 1 threads using dma0chan4
dmatest: Started 1 threads using dma0chan5
dmatest: Started 1 threads using dma0chan6
dmatest: Started 1 threads using dma0chan7
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Sending DHCP requests ., OK
IP-Config: Got DHCP answer from 10.0.2.2, my address is 10.0.2.15
IP-Config: Complete:
     device=eth0, hwaddr=a6:03:ef:b9:9d:0c, ipaddr=10.0.2.15, mask=255.255.255.0, gw=10.0.2.2
     host=10.0.2.15, domain=, nis-domain=(none)
     bootserver=10.0.2.2, rootserver=10.0.2.2, rootpath=
     nameserver0=10.0.2.3RAMDISK: Couldn't find valid RAM disk image starting at 0.
List of all partitions:
1f00            1024 mtdblock0  (driver?)
1f01            5120 mtdblock1  (driver?)
1f02             128 mtdblock2  (driver?)
1f03            6016 mtdblock3  (driver?)
1f04           20480 mtdblock4  (driver?)
No filesystem could mount root, tried:  ext3 ext2 ext4 vfat msdos
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
CPU0: stopping
[<c00142d0>] (unwind_backtrace+0x0/0x11c) from [<c00131e0>] (ipi_cpu_stop+0x3c/0x6c)
[<c00131e0>] (ipi_cpu_stop+0x3c/0x6c) from [<c0013460>] (handle_IPI+0x60/0xa4)
[<c0013460>] (handle_IPI+0x60/0xa4) from [<c00084e0>] (gic_handle_irq+0x58/0x60)
[<c00084e0>] (gic_handle_irq+0x58/0x60) from [<c000e140>] (__irq_svc+0x40/0x70)
Exception stack(0xee1b3e20 to 0xee1b3e68)
3e20: ee361ac0 00000158 000000d4 000000d4 00000000 000000c0 00000158 ee361ac0
3e40: ee35c000 00000000 00001e14 ffffff67 00003a58 ee1b3e68 c01e5be4 c03b5364
3e60: 80000113 ffffffff
[<c000e140>] (__irq_svc+0x40/0x70) from [<c03b5364>] (dmatest_verify+0x2c/0x11c)
[<c03b5364>] (dmatest_verify+0x2c/0x11c) from [<c01e5be4>] (dmatest_func+0xc3c/0xe64)
[<c01e5be4>] (dmatest_func+0xc3c/0xe64) from [<c003acb4>] (kthread+0xa0/0xb0)
[<c003acb4>] (kthread+0xa0/0xb0) from [<c000e5d8>] (ret_from_fork+0x14/0x3c)

 

One other interesting point is that I downloaded zynq_linux.tar.gz and had no trouble running it using ./start_qemu.sh. Unfortunately this download doesn't appear to be mentioned anywhere on the Xilinx site now, so I get the impression that it is outdated and not supported?


Accepted Solutions
Xilinx Employee
Posts: 444
Registered: ‎03-13-2012

Re: Getting started with Zynq 14.5 and QEMU

Problem solved: The qemu's '-initrd' switch expects a plain initrd/initramfs. Not one with a u-boot header. Stripping the u-boot header from the uramdisk.image.gz file works. I think I'll upload that file to the wiki later. To remove the u-boot header from the uramdisk.image.gz file use the following command:

dd if=./uramdisk.image.gz of=./ramdisk.image.gz skip=16 bs=4

And then use the file 'ramdisk.image.gz' to boot on qemu.

View solution in original post


All Replies
Xilinx Employee
Posts: 444
Registered: ‎03-13-2012

Re: Getting started with Zynq 14.5 and QEMU

I have to admit, I didn't test the images with qemu and doing so gains the same result you see.

We'll look into this. Please have some patience.

Xilinx Employee
Posts: 444
Registered: ‎03-13-2012

Re: Getting started with Zynq 14.5 and QEMU

Problem solved: The qemu's '-initrd' switch expects a plain initrd/initramfs. Not one with a u-boot header. Stripping the u-boot header from the uramdisk.image.gz file works. I think I'll upload that file to the wiki later. To remove the u-boot header from the uramdisk.image.gz file use the following command:

dd if=./uramdisk.image.gz of=./ramdisk.image.gz skip=16 bs=4

And then use the file 'ramdisk.image.gz' to boot on qemu.