QEMU emulation
Open, Needs TriagePublic

Description

Requirements:

  • LinuxMint 18.1 or Ubuntu ??.?

Build Xilinx QEMU

#!/bin/bash

#TODO: Create "update" version of the script, package retrieving and cloning should be done one time only
prerequisites="build-essential libglib2.0-dev libgcrypt20-dev zlib1g-dev autoconf automake libtool bison flex git"

if [[ $EUID != 0 ]];
then
    echo "Please run as sudo";
    exit;
fi

apt-get update
apt-get install $prerequisites

git clone git://github.com/Xilinx/qemu.git
cd qemu
git submodule update --init pixman dtc

./configure --target-list="aarch64-softmmu,microblazeel-softmmu" --enable-fdt --disable-kvm --disable-xen

make -j4

QEMU start script

#!/bin/bash

target_dir="./images/mymod"
image="./beta_20170109.dd"
dtb="devicetree.dtb"
kernel="zImage"

# Start QEMU
./qemu/aarch64-softmmu/qemu-system-aarch64 \
-M arm-generic-fdt-7series -machine linux=on -m 1024 \
-serial null -serial mon:stdio -nographic -boot mode=3 \
-dtb $target_dir/$dtb \
-kernel $target_dir/$kernel -append "root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4 systemd.log_level=warning systemd.log_target=console kernel.sysrq=1 init=/usr/lib/systemd/systemd" \
-drive file=$target_dir/$image,if=sd,format=raw,index=0

TODO

  • zImage (kernel) and .dtb (device tree) have to be supplied seprately, as boot bin has problems to start in QEMU, neds investigation

Current state

Boot works, needs some time. But further inspection is needed to verify that it works to the level where one can develop through remote debug for example.

BAndiT1983 updated the task description. (Show Details)
BAndiT1983 raised the priority of this task from to Needs Triage.
BAndiT1983 claimed this task.
BAndiT1983 moved this task to Backlog on the AXIOM Beta Software board.
BAndiT1983 added subscribers: BAndiT1983, Bertl.
BAndiT1983 updated the task description. (Show Details)Feb 12 2017, 1:14 AM
BAndiT1983 updated the task description. (Show Details)Feb 12 2017, 1:23 AM
BAndiT1983 updated the task description. (Show Details)Feb 12 2017, 10:53 AM
BAndiT1983 updated the task description. (Show Details)Feb 12 2017, 11:42 AM
BAndiT1983 updated the task description. (Show Details)Feb 12 2017, 11:48 AM
BAndiT1983 updated the task description. (Show Details)Feb 12 2017, 1:01 PM
BAndiT1983 updated the task description. (Show Details)Feb 12 2017, 11:09 PM
BAndiT1983 updated the task description. (Show Details)Feb 12 2017, 11:13 PM
BAndiT1983 updated the task description. (Show Details)Feb 15 2017, 10:09 PM
sebastian added a comment.EditedJun 21 2017, 2:56 PM

Bertl on IRC:
http://irc.apertus.org/index.php?day=15&month=06&year=2017#107

qemu-system-aarch64 -M arm-generic-fdt-7series -machine linux=on -m 1024 -serial /dev/null -serial mon:stdio -nographic -hw-dtb devicetree.dtb -kernel u-boot -drive if=sd,format=raw,index=0,file=beta_20170109.dd -boot mode=5

get the devicetree.dtb from the first partition of the image and the u-boot from here: http://vserver.13thfloor.at/Stuff/AXIOM/BETA/u-boot

this should boot up to the beta login prompt

Champika would you be so kind an commit all latest files related to getting QEMU setup and running plus readme to https://github.com/apertus-open-source-cinema/axiom-beta-qemu

sebastian added a comment.EditedJun 22 2017, 2:24 PM

Linux Mint 18.1:

sfdisk -v
sfdisk from util-linux 2.27.1

says:

sfdisk: --Linux option is unnecessary and deprecated
sfdisk: invalid option -- 'S'

mkfs.ext4: invalid option -- 'd'

I committed a first version of the build script to github

commit and updated the scripts to build and run QEMU: https://github.com/apertus-open-source-cinema/axiom-beta-qemu

Hello! How can I help?

Hello! How can I help?

Try running the axiom_beta_build_image_Ubuntu.sh from https://github.com/apertus-open-source-cinema/axiom-beta-qemu in an Ubuntu OS and report the results. The last commented out line in that script starts the created image in qemu.

I got a kernel panic then so that would need investigation.

@pgsamila was so kind and adapt the axiom_beta_build_image_Ubuntu.sh script to use kernel version 4.6 as there are known issues with 4.9 (latest).

There are still some unresolved issues, I logged the entire build process here:

https://pastebin.com/B3FuTpRG

@sebastian I think issues are with the name of cloning dir or I think we should use a recipe for building kernel 4.6.0. Will check it again and create a PR soon.

The following is log of build on Manjaro Community 17.1.5 (arch)
https://pastebin.com/GZ136Ure

Logs from LinuxMint 18.3

Failing in prepare.sh:

fatal: reference is not a tree: 1d9d9d8bdb02aa2ab316e6571d495b8090f8a25d
Unable to checkout '27e66e59a39f63cfbc120bf1d26bc6b63f1b4f6c' in submodule path 'external/util-linux'
Unable to checkout '1d9d9d8bdb02aa2ab316e6571d495b8090f8a25d' in submodule path 'qemu-xilinx'

There are still issues with the build scripts: most importantly, the sha256 checksums do not match for xilinx. (./guest-images/dev/microzed-image-1.3/build.sh, which should be ./guest-images/dev/microzed-image-1.4/build.sh, given the patch at https://github.com/apertus-open-source-cinema/axiom-beta-qemu/tree/ffe128c9cbff62e75bd0c5d44ef1f914c393fd8f)

Also, the following command has issue: ./guest-images/dev/beta-software/build.sh:

Also, there is a small issue: ./run_image.sh dev/microzed-image-1.3 runs run_image.sh which is not in the project. Maybe it is ./runQEMU.sh ?