Skip to content

Commit 97879f4

Browse files
yfliuuuacrnsi-robot
authored andcommitted
doc: Add initial documentation on ACRN RISC-V
This commit adds documentation on buildling and running ACRN hypervisor on top of QEMU RISC-V. Tracked-On: #8782 Signed-off-by: Yifan Liu <[email protected]> Acked-by: Wang, Yu1 <[email protected]>
1 parent 1a2d5b9 commit 97879f4

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

doc/reference/hv-make-options.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,17 @@ Example of how to use ``hvapplydiffconfig`` to apply
231231
Applying patch /path/to/acrn-hypervisor/config.patch:
232232
patching file scenarios/hybrid_rt/pci_dev.c
233233
...
234+
235+
Experimental (Multi-Arch Support)
236+
*********************************
237+
238+
(WIP, Unstable)
239+
240+
ACRN also supports running on multiple architectures. To build hypervisor for
241+
other architecture, add ``ARCH=<arch>``, and ``CROSS_COMPILE=<toolchainprefix>``.
242+
For example:
243+
244+
.. code-block:: none
245+
246+
$ make hypervisor BOARD=qemu SCENARIO=shared ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-
247+

doc/tutorials/acrn_on_qemu.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,3 +308,35 @@ Bring Up User VM (L2 Guest)
308308
fi
309309
done
310310
launch_ubuntu 1
311+
312+
Experimental: Running ACRN on QEMU RISCV-64
313+
*******************************************
314+
315+
(WIP, Unstable)
316+
317+
The following documentation is tested under Ubuntu 24.04.
318+
319+
To compile and run ACRN on QEMU RISCV-64, we need to first install
320+
QEMU RV64 and crossbuild toolchains. The default packages provided by
321+
Ubuntu 24.04 will suffice:
322+
323+
.. code-block:: bash
324+
325+
sudo apt install crossbuild-essential-riscv64 qemu-system-misc u-boot-qemu opensbi
326+
327+
To run ACRN on QEMU RISCV-64, first compile ACRN towards QEMU:
328+
329+
.. code-block:: bash
330+
331+
make hypervisor BOARD=qemu SCENARIO=shared ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu-
332+
333+
The ACRN ELF binary is generated under ``build/hypervisor/acrn.out``.
334+
335+
Then run QEMU with the following parameters:
336+
337+
.. code-block:: bash
338+
339+
qemu-system-riscv64 -nographic -machine virt -cpu rv64 -m 8G -smp 4 \
340+
-kernel /path/to/acrn-root/build/hypervisor/acrn.out
341+
342+
ACRN currently only prints out "Hello World!".

0 commit comments

Comments
 (0)