QEMU can run a single program built for another processor, not just whole systems
In short: QEMU is a free, open-source tool that can emulate complete computers, and it can also run one program built for a different processor type. Its built-in translator converts machine code on the fly. Developers use it to test software on hardware they do not own, and it underpins several other well-known projects.
QEMU, short for Quick Emulator, is a free and open-source emulator and virtualizer. Fabrice Bellard originally developed it, and the first preview release appeared in 2003. Its components are published under several compatible licences, including the GPL, the BSD licence and the LGPL. QEMU supports emulation of many processor families, including x86, ARM, PowerPC and RISC-V. It works in several modes. In user-mode emulation it runs a single Linux or Darwin/macOS program compiled for another instruction set, adjusting system calls where byte order or word size differs. In system emulation it reproduces a full computer with its peripherals, so several virtual machines can share one physical host. In hypervisor mode it either manages virtual machines itself or provides device emulation to hypervisors such as KVM, Xen, Apple's HVF and Windows' WHPX.
The core of much of this is the Tiny Code Generator, or TCG. QEMU converts blocks of target code into a machine-independent intermediate form, applies simple optimisation passes, and then emits code for the host processor. Each supported architecture needs dedicated support for this final step. Where that support is missing, TCG falls back to a slower interpreter. TCG replaced an older system called DynGen from QEMU version 0.10.0 onward. An earlier kernel module, KQEMU, had sped up x86 guests by running user-mode code directly on the host CPU, but newer QEMU releases dropped it. On Linux, KVM has largely taken over that role, and QEMU can also use KVM on ARM and MIPS.
QEMU's practical reach is broad. Its QCOW2 disk format stores only the space actually used, and overlay files record changes against a base image, so a guest can be rolled back to an earlier state. It can emulate many network cards, share the host's connectivity, expose a guest screen through an integrated VNC server, and run without any graphical output on the host. Its device list covers disks, USB controllers, sound cards and VirtIO paravirtual devices, and it can run several virtual CPUs.
QEMU has also served as a foundation for other software. VirtualBox once used parts of its virtual hardware and a re-compiler based on it, and Unicorn is a CPU emulation framework built on the TCG engine that omits peripherals. The trade-off of translation is that running a foreign architecture is usually slower than running native code, which is why hardware acceleration matters so much in practice.
Opens the Intellect+ feed with this card first. Swipe up for the next one.
Sources
- Summary by Intellect · source: QEMU
To cite this card, link to https://intellectplus.co.uk/app/technology-qemu.
How we source, check and correct cards: Editorial standards.
General information, not professional advice. Spotted an error? Flag the card or see corrections and complaints.
Intellect Plus is a visual educational discovery platform for exploring fascinating facts and ideas. Brain Food, Not Brain Rot. What is Intellect Plus?
Related
More in Computing and information technology · More in Technology · Latest · A–Z · All topics