第一步:安装qemu
apt-get -y qemu
第二步:下载build-root kernel镜像,并用qemu-system-aarch64 起虚拟机
wget http://people.linaro.org/~alex.bennee/images/aarch64-linux-3.15rc2-buildroot.img qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic -smp 1 -m 2048 -kernel aarch64-linux-3.15rc2-buildroot.img --append "console=ttyAMA0"
来源:
Running Linux in QEMU’s aarch64 system emulation mode
Since I started working on aarch64 support for QEMU the most frequently asked question I got was “when can I run aarch64 system emulation on QEMU?”. Well wait no more as support for a VIRT-IO based aarch64 board was recently merged into the master branch of QEMU. In this post I’ll talk about building QEMU, a rootfs and a kernel that will allow you to start experimenting with the architecture.
Quick start
Let’s first start with building and running QEMU with some pre-built images.
BUILD DEPENDANCIES
As has been noted in the comments the configure script will automatically enable features as long as the pre-requisite developer libraries are installed on your sytem. With a Debian/Ubuntu system this is easily achieved by running:
sudo apt-get build-dep qemu
Of course if you want to enable a feature (either a bleeding edge or non-standard) that requires additional libraries then you will need to install the appropriate development packages manually. The config.log file is usually a useful first step in working out what headers are being looked for.
BUILDING QEMU
git clone git://git.qemu.org/qemu.git qemu.git cd qemu.git ./configure --target-list=aarch64-softmmu make
Assuming the build ran without any problems you should now have an executable ./aarch64-softmmu/qemu-system-aarch64 in your build directory. Grab a pre-built image from here and we’ll check it works. The image is a kernel that has been combined with an initial RAM disk (initrd) with a basic root file-system. I go into more details on how to create this later on.
Be aware the command line is quite long so make sure you copy it all