QEMU Emulation for X86
Overview
The X86 QEMU board configuration is used to emulate the X86 architecture.
This board configuration provides support for a 32-bit Atom-class x86 CPU and the following devices:
HPET
Advanced Programmable Interrupt Controller (APIC)
NS16550 UART
E1000 Ethernet, CAN and VirtIO input devices on an emulated PCI bus
Simulated flash and EEPROM
QEMU ramfb display
The qemu_x86/atom/* variants exercise the same machine with a particular
memory-management configuration (no MMU, 32-bit page tables, KPTI disabled,
execute-in-place, or a relocated virtual address space); qemu_x86_tiny
uses the same devicetree with only 384 KiB of RAM to test demand paging.
Hardware
Supported Features
The qemu_x86 board supports the hardware features listed below.
- on-chip / on-board
- Feature integrated in the SoC / present on the board.
- 2 / 2
-
Number of instances that are enabled / disabled.
Click on the label to see the first instance of this feature in the board/SoC DTS files. -
vnd,foo -
Compatible string for the Devicetree binding matching the feature.
Click on the link to view the binding documentation.
qemu_x86/atom target
On-target memory for this board target: 32 MiB of RAM, 4 MiB of Flash.
Type |
Location |
Description |
Compatible |
|---|---|---|---|
CPU |
on-chip |
Generic x86 qemu CPU1 |
|
CAN |
on-board |
Kvaser PCIcan1 |
|
Display |
on-board |
QEMU RAM framebuffer display device1 |
|
Ethernet |
on-board |
Intel E1000 Ethernet controller1 |
|
Firmware |
on-board |
QEMU fw_cfg (I/O port transport)1 |
|
Input |
on-board |
VIRTIO Input device1 |
|
Interrupt controller |
on-chip |
Intel I/O Advanced Programmable Interrupt Controller (APIC)1 |
|
on-chip |
Local Advanced Programmable Interrupt Controller (APIC)1 |
||
Multi-Function Device |
on-chip |
Motorola MC146818 MFD1 |
|
MTD |
on-board |
Flash node2 |
|
PCIe |
on-board |
Generic PCIe host controller1 |
|
RTC |
on-chip |
Motorola MC146818 compatible Real Timer Clock1 |
|
Serial controller |
on-chip |
ns16550 UART2 |
|
Timer |
on-chip |
HPET (High-Precision Event Timer)1 |
|
Virtio |
on-board |
VIRTIO over PCI1 |
Devices
HPET System Clock Support
The configuration uses an HPET clock frequency of 25 MHz.
Serial Port
The board configuration uses a single serial communication channel that uses the NS16550 serial driver operating in polling mode. To override, enable the UART_INTERRUPT_DRIVEN Kconfig option, which allows the system to be interrupt-driven.
If SLIP networking is enabled (see below), an additional serial port will be used for it.
Known Problems or Limitations
The following platform features are unsupported:
Isolated Memory Regions
Serial port in Direct Memory Access (DMA) mode
Serial Peripheral Interface (SPI) flash
General-Purpose Input/Output (GPIO)
Inter-Integrated Circuit (I2C)
Ethernet
Supervisor Mode Execution Protection (SMEP)
Programming and Debugging
The qemu_x86 board supports the runners and associated west commands listed below.
| flash | debug | debugserver | |
|---|---|---|---|
| qemu | ✅ (default) | ✅ (default) | ✅ |
Applications for the qemu_x86 board configuration can be built and run in
the usual way for emulated boards (see Building an Application and
Run an Application for more details).
Flashing
While this board is emulated and you can’t “flash” it, you can use this configuration to run basic Zephyr applications and kernel tests in the QEMU emulated environment. For example, with the Basic Synchronization sample:
# From the root of the zephyr repository
west build -b qemu_x86 samples/synchronization
west build -t run
This will build an image with the synchronization sample app, boot it using QEMU, and display the following console output:
***** BOOTING ZEPHYR OS v1.8.99 - BUILD: Jun 27 2017 13:09:26 *****
threadA: Hello World from x86!
threadB: Hello World from x86!
threadA: Hello World from x86!
threadB: Hello World from x86!
threadA: Hello World from x86!
threadB: Hello World from x86!
threadA: Hello World from x86!
threadB: Hello World from x86!
threadA: Hello World from x86!
threadB: Hello World from x86!
Exit QEMU by pressing CTRL+A x.
Debugging
Refer to the detailed overview about Application Debugging.
Networking
The board supports SLIP networking over an emulated serial port
(CONFIG_NET_SLIP_TAP=y). The detailed setup is described in
Networking with QEMU.
It is also possible to use the QEMU built-in Ethernet adapter to connect to the host system. This is faster than using SLIP and is also the preferred way. See Networking with QEMU Ethernet for details.