README.rst
1.. _xen_dom0:
2
3Xen Dom0: universal snippet for XEN control domain
4##################################################
5
6Overview
7********
8
9This snippet allows user to build Zephyr as a Xen initial domain (Dom0). The feature
10is implemented as configuration snippet to allow support for any compatible platform.
11
12How to add support of a new board
13*********************************
14
15* add board dts overlay to this snippet which deletes/adds memory and deletes UART nodes;
16* add correct memory and hypervisor nodes, based on regions Xen picked for Domain-0 on your setup.
17
18Programming
19***********
20
21Correct snippet designation for Xen must
22be entered when you invoke ``west build``.
23For example:
24
25.. code-block:: console
26
27 west build -b qemu_cortex_a53 -S xen_dom0 samples/synchronization
28
29QEMU example with Xen
30***********************
31
32Overlay for qemu_cortex_a53 board, that is present in `board/` directory of this snippet is QEMU
33Xen control domain example. To run such setup, you need to:
34
35* fetch and build Xen (e.g. RELEASE-4.17.0) for arm64 platform
36* take and compile sample device tree from `example/` directory
37* build your Zephyr sample/application with `xen_dom0` snippet and start it as Xen control domain
38
39For starting you can use QEMU from Zephyr SDK by following command:
40
41.. code-block:: console
42
43 <path to Zephyr SDK>/sysroots/x86_64-pokysdk-linux/usr/bin/qemu-system-aarch64 -cpu cortex-a53 \
44 -m 6G -nographic -machine virt,gic-version=3,virtualization=true -chardev stdio,id=con,mux=on \
45 -serial chardev:con -mon chardev=con,mode=readline -pidfile qemu.pid \
46 -device loader,file=<path to Zephyr app build>/zephyr.bin,addr=0x40600000 \
47 -dtb <path to DTB>/xen.dtb -kernel <path to Xen build>/xen
48
49This will start you a Xen hypervisor with your application as Xen control domain. To make it usable,
50you can add `zephyr-xenlib` by Xen-troops library to your project. It'll provide basic domain
51management functionalities - domain creation and configuration.
52