Documentation/Platforms/ARM: Difference between revisions

From QEMU
(Created page with '= QEMU ARM guest support = QEMU has generally good support for ARM guests. It has support for nearly fifty different machines. The reason we support so many is that ARM hardware…')
 
Line 31: Line 31:
: Check whether QEMU lists that machine in its '-machine help' output. If it does, that's the best place to start. If it doesn't then unfortunately you're out of luck: your image won't boot on QEMU. If it's a Linux image and you're mostly interested in the userspace software, then you may be able to extract the filesystem and use that with a different kernel which boots on a system QEMU does emulate.
: Check whether QEMU lists that machine in its '-machine help' output. If it does, that's the best place to start. If it doesn't then unfortunately you're out of luck: your image won't boot on QEMU. If it's a Linux image and you're mostly interested in the userspace software, then you may be able to extract the filesystem and use that with a different kernel which boots on a system QEMU does emulate.
; I don't really care which system I emulate, I just want to run Linux...
; I don't really care which system I emulate, I just want to run Linux...
: Most of the machines QEMU supports have annoying limitations (small amount of RAM, no PCI or other hard disk, etc) which are there because that's what the real hardware is like. If you don't care about that, the best choice today is the "virt" machine. This is a platform which doesn't correspond to any real hardware and is designed for use in virtual machines. It supports PCI, virtio, recent CPUs and large amounts of RAM. The only thing it doesn't have is graphics. See [https://translatedcode.wordpress.com/2016/11/03/installing-debian-on-qemus-32-bit-arm-virt-board/ this tutorial] for information on getting 32-bit ARM Debian Linux running on the "virt" board.
: Most of the machines QEMU supports have annoying limitations (small amount of RAM, no PCI or other hard disk, etc) which are there because that's what the real hardware is like. If you don't care about reproducing the idiosyncrasies of a particular bit of hardware, the best choice today is the "virt" machine. This is a platform which doesn't correspond to any real hardware and is designed for use in virtual machines. It supports PCI, virtio, recent CPUs and large amounts of RAM. The only thing it doesn't have is graphics. See [https://translatedcode.wordpress.com/2016/11/03/installing-debian-on-qemus-32-bit-arm-virt-board/ this tutorial] for information on getting 32-bit ARM Debian Linux running on the "virt" board.
:For 64-bit ARM "virt" is also the best choice. We don't have a link to a simple tutorial yet, though.
:For 64-bit ARM "virt" is also the best choice. We don't have a link to a simple tutorial yet, though.
:The "versatilepb" machine has also often been used as a general-purpose Linux target in the past; its disadvantage is that it has a very old CPU and only 256MB of RAM, but it does at least have PCI and SCSI. You can find a description of how to install Debian on it [https://www.aurel32.net/info/debian_arm_qemu.php here] (the author of that tutorial has also provided [https://people.debian.org/~aurel32/qemu/armel/ some prebuilt images]). You're probably better off using "virt" though.
:The "versatilepb" machine has also often been used as a general-purpose Linux target in the past; its disadvantage is that it has a very old CPU and only 256MB of RAM, but it does at least have PCI and SCSI. You can find a description of how to install Debian on it [https://www.aurel32.net/info/debian_arm_qemu.php here] (the author of that tutorial has also provided [https://people.debian.org/~aurel32/qemu/armel/ some prebuilt images]). You're probably better off using "virt" though.

Revision as of 21:54, 5 November 2016

QEMU ARM guest support

QEMU has generally good support for ARM guests. It has support for nearly fifty different machines. The reason we support so many is that ARM hardware is much more widely varying than x86 hardware. ARM CPUs are generally built into "system-on-chip" (SoC) designs created by many different companies with different devices, and these SoCs are then built into machines which can vary still further even if they use the same SoC. Even with fifty boards QEMU does not cover more than a small fraction of the ARM hardware ecosystem.

Because ARM systems differ so much and in fundamental ways, typically operating system or firmware images intended to run on one machine will not run at all on any other. This is often surprising for new users who are used to the x86 world where every system looks like a standard PC. (Once the kernel has booted, most userspace software cares much less about the detail of the hardware.)

The situation for 64-bit ARM is fairly similar, except that we don't implement so many different machines.

As well as the more common "A-profile" CPUs (which have MMUs and will run Linux) we also support the Cortex-M3 and Cortex-M4 "M-profile" CPUs (which are microcontrollers used in very embedded boards. We only have two boards which use the M-profile CPU at the moment: "lm3s811evb" and "lm3s6965evb" (which are both TI Stellaris evaluation boards).

Guidelines for choosing a QEMU machine

I have a complete system image already that works on hardware that I'd like to boot with QEMU...
Check whether QEMU lists that machine in its '-machine help' output. If it does, that's the best place to start. If it doesn't then unfortunately you're out of luck: your image won't boot on QEMU. If it's a Linux image and you're mostly interested in the userspace software, then you may be able to extract the filesystem and use that with a different kernel which boots on a system QEMU does emulate.
I don't really care which system I emulate, I just want to run Linux...
Most of the machines QEMU supports have annoying limitations (small amount of RAM, no PCI or other hard disk, etc) which are there because that's what the real hardware is like. If you don't care about reproducing the idiosyncrasies of a particular bit of hardware, the best choice today is the "virt" machine. This is a platform which doesn't correspond to any real hardware and is designed for use in virtual machines. It supports PCI, virtio, recent CPUs and large amounts of RAM. The only thing it doesn't have is graphics. See this tutorial for information on getting 32-bit ARM Debian Linux running on the "virt" board.
For 64-bit ARM "virt" is also the best choice. We don't have a link to a simple tutorial yet, though.
The "versatilepb" machine has also often been used as a general-purpose Linux target in the past; its disadvantage is that it has a very old CPU and only 256MB of RAM, but it does at least have PCI and SCSI. You can find a description of how to install Debian on it here (the author of that tutorial has also provided some prebuilt images). You're probably better off using "virt" though.