2017-01-15 05:58:20 +08:00
|
|
|
.. _qemu_x86:
|
|
|
|
|
|
|
|
X86 Emulation (QEMU)
|
|
|
|
####################
|
|
|
|
|
|
|
|
Overview
|
2017-01-21 07:58:05 +08:00
|
|
|
********
|
2017-01-15 05:58:20 +08:00
|
|
|
|
2019-02-10 23:57:07 +08:00
|
|
|
The X86 QEMU board configuration is used to emulate the X86 architecture.
|
|
|
|
|
|
|
|
.. figure:: qemu_x86.png
|
|
|
|
:width: 600px
|
|
|
|
:align: center
|
|
|
|
:alt: Qemu
|
|
|
|
|
|
|
|
Qemu (Credit: qemu.org)
|
|
|
|
|
|
|
|
This board configuration provides support for an x86 Minute IA (Lakemont) CPU
|
|
|
|
and the following devices:
|
2017-01-15 05:58:20 +08:00
|
|
|
|
|
|
|
* HPET
|
|
|
|
* Advanced Programmable Interrupt Controller (APIC)
|
|
|
|
* NS16550 UART
|
|
|
|
|
|
|
|
|
|
|
|
Hardware
|
2017-01-21 07:58:05 +08:00
|
|
|
********
|
2017-01-15 05:58:20 +08:00
|
|
|
|
|
|
|
Supported Features
|
2017-01-21 07:58:05 +08:00
|
|
|
==================
|
2017-01-15 05:58:20 +08:00
|
|
|
|
2017-06-27 21:27:04 +08:00
|
|
|
This configuration supports the following hardware features:
|
2017-01-15 05:58:20 +08:00
|
|
|
|
|
|
|
+--------------+------------+-----------------------+
|
|
|
|
| Interface | Controller | Driver/Component |
|
|
|
|
+==============+============+=======================+
|
|
|
|
| HPET | on-chip | system clock |
|
|
|
|
+--------------+------------+-----------------------+
|
|
|
|
| APIC | on-chip | interrupt controller |
|
|
|
|
+--------------+------------+-----------------------+
|
|
|
|
| NS16550 | on-chip | serial port |
|
|
|
|
| UART | | |
|
|
|
|
+--------------+------------+-----------------------+
|
|
|
|
|
|
|
|
Devices
|
2017-01-21 07:58:05 +08:00
|
|
|
=======
|
2017-01-15 05:58:20 +08:00
|
|
|
|
|
|
|
HPET System Clock Support
|
2017-01-21 07:58:05 +08:00
|
|
|
-------------------------
|
2017-01-15 05:58:20 +08:00
|
|
|
|
2017-06-27 21:27:04 +08:00
|
|
|
The configuration uses an HPET clock frequency of 25 MHz.
|
2017-01-15 05:58:20 +08:00
|
|
|
|
|
|
|
Serial Port
|
2017-01-21 07:58:05 +08:00
|
|
|
-----------
|
2017-01-15 05:58:20 +08:00
|
|
|
|
2017-06-27 21:27:04 +08:00
|
|
|
The board configuration uses a single serial communication channel that
|
2017-01-15 05:58:20 +08:00
|
|
|
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.
|
|
|
|
|
2017-06-29 20:55:43 +08:00
|
|
|
If SLIP networking is enabled (see below), an additional serial port will be
|
|
|
|
used for it.
|
|
|
|
|
2017-01-15 05:58:20 +08:00
|
|
|
Known Problems or Limitations
|
2017-01-21 07:58:05 +08:00
|
|
|
=============================
|
2017-01-15 05:58:20 +08:00
|
|
|
|
|
|
|
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)
|
2017-06-27 21:27:04 +08:00
|
|
|
|
|
|
|
Programming and Debugging
|
|
|
|
*************************
|
|
|
|
|
2017-11-04 05:56:42 +08:00
|
|
|
Applications for the ``qemu_x86`` board configuration can be built and run in
|
|
|
|
the usual way for emulated boards (see :ref:`build_an_application` and
|
|
|
|
:ref:`application_run` for more details).
|
2017-06-27 21:27:04 +08:00
|
|
|
|
2017-11-04 05:56:42 +08:00
|
|
|
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 :ref:`synchronization_sample`:
|
2017-06-27 21:27:04 +08:00
|
|
|
|
2017-11-04 05:56:42 +08:00
|
|
|
.. zephyr-app-commands::
|
|
|
|
:zephyr-app: samples/synchronization
|
2018-01-18 00:32:31 +08:00
|
|
|
:host-os: unix
|
2017-11-04 05:56:42 +08:00
|
|
|
:board: qemu_x86
|
|
|
|
:goals: run
|
2017-06-27 21:27:04 +08:00
|
|
|
|
|
|
|
This will build an image with the synchronization sample app, boot it using
|
|
|
|
QEMU, and display the following console output:
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
***** 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!
|
|
|
|
|
2019-08-29 06:46:09 +08:00
|
|
|
Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`.
|
|
|
|
|
2017-06-27 21:27:04 +08:00
|
|
|
Debugging
|
|
|
|
=========
|
|
|
|
|
|
|
|
Refer to the detailed overview about :ref:`application_debugging`.
|
2017-06-29 20:55:43 +08:00
|
|
|
|
|
|
|
Networking
|
|
|
|
==========
|
|
|
|
|
|
|
|
The board supports SLIP networking over an emulated serial port
|
|
|
|
(``CONFIG_NET_SLIP_TAP=y``). The detailed setup is described in
|
|
|
|
:ref:`networking_with_qemu`.
|
2019-02-19 16:42:07 +08:00
|
|
|
|
|
|
|
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 :ref:`networking_with_eth_qemu` for details.
|