Skip to content

Commit a3251d8

Browse files
dbkinderwenlingz
authored andcommitted
doc: incorporate scenario-based doc update
PR #3516 was submitted during a documentation reorganization and resulted in merge conflicts with files that no longer exist. We closed that PR and opened this one with those changes applied to the right files. Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
1 parent defac8d commit a3251d8

File tree

4 files changed

+135
-41
lines changed

4 files changed

+135
-41
lines changed

doc/getting-started/building-from-source.rst

Lines changed: 94 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -171,42 +171,80 @@ each with their own way to install development tools:
171171
details.
172172

173173

174-
Build the hypervisor, device model and tools
175-
********************************************
174+
Get the ACRN hypervisor source code
175+
***********************************
176176

177177
The `acrn-hypervisor <https://github.com/projectacrn/acrn-hypervisor/>`_
178178
repository has four main components in it:
179179

180180
1. The ACRN hypervisor code located in the ``hypervisor`` directory
181-
#. The EFI stub code located in the ``efi-stub`` directory
181+
#. The EFI stub code located in the ``misc/efi-stub`` directory
182182
#. The ACRN devicemodel code located in the ``devicemodel`` directory
183-
#. The ACRN tools source code located in the ``tools`` directory
183+
#. The ACRN tools source code located in the ``misc/tools`` directory
184184

185-
You can build all these components in one go as follows:
185+
Follow this step to get the acrn-hypervisor source code:
186186

187187
.. code-block:: none
188188
189189
$ git clone https://github.com/projectacrn/acrn-hypervisor
190-
$ cd acrn-hypervisor
191-
$ make
192190
193-
The build results are found in the ``build`` directory.
194191
195-
.. note::
196-
if you wish to use a different target folder for the build
197-
artifacts, set the ``O`` (that is capital letter 'O') to the
198-
desired value. Example: ``make O=build-nuc BOARD=nuc6cayh``.
192+
Choose the ACRN scenario
193+
************************
194+
195+
.. note:: Documentation about the new ACRN use-case scenarios is a
196+
work-in-progress on the master branch as we work towards the v1.2
197+
release.
198+
199+
Currently ACRN hypervisor defines these typical usage scenarios:
200+
201+
SDC:
202+
The SDC (Software Defined Cockpit) scenario defines a simple
203+
automotive use-case where there is one pre-launched Service VM and one
204+
post-launched User VM.
199205

200-
Generating the documentation is described in details in the :ref:`acrn_doc`
201-
tutorial.
206+
SDC2:
207+
SDC2 (Software Defined Cockpit 2) is an extended scenario for an
208+
automotive SDC system. SDC2 defined one pre-launched Service VM and up
209+
to three post-launched VMs.
202210

203-
Follow the same instructions to boot and test the images you created
204-
from your build.
211+
LOGICAL_PARTITION:
212+
This scenario defines two pre-launched VMs.
213+
214+
INDUSTRY:
215+
This is a typical scenario for industrial usage with up to four VMs:
216+
one pre-launched Service VM, one post-launched Standard VM for Human
217+
interaction (HMI), and one or two post-launched RT VMs for real-time
218+
control.
219+
220+
HYBRID:
221+
This scenario defines a hybrid use-case with three VMs: one
222+
pre-launched VM, one pre-launched Service VM, and one post-launched
223+
Standard VM.
224+
225+
You can select a build scenario by changing the default Kconfig name in
226+
the choice block of **ACRN Scenario** in ``arch/x86/Kconfig``. The
227+
corresponding VM configuration files in the corresponding
228+
``scenarios/$SCENARIO_NAME/`` folder.
229+
230+
.. code-block:: none
231+
:emphasize-lines: 7
232+
233+
$ cd acrn-hypervisor/hypervisor
234+
$ sudo vim arch/x86/Kconfig
235+
# <Fill the scenario name into below and save>
236+
237+
choice
238+
prompt "ACRN Scenario"
239+
default SDC
240+
241+
See the :ref:`hardware` document for information about the platform
242+
needs for each scenario.
205243

206244
.. _getting-started-hypervisor-configuration:
207245

208-
Configuring the hypervisor
209-
**************************
246+
Modify the hypervisor configuration
247+
***********************************
210248

211249
The ACRN hypervisor leverages Kconfig to manage configurations, powered by
212250
Kconfiglib. A default configuration is generated based on the board you have
@@ -220,43 +258,64 @@ based on the platform selected, assuming that you are under the top-level
220258
directory of acrn-hypervisor. The configuration file, named ``.config``, can be
221259
found under the target folder of your build.
222260

223-
.. code-block:: none
261+
.. code-block:: none
224262
225-
$ cd hypervisor
226-
$ make defconfig BOARD=nuc6cayh
263+
$ make defconfig BOARD=nuc6cayh
227264
228265
The BOARD specified is used to select a defconfig under
229266
``arch/x86/configs/``. The other command-line based options (e.g. ``RELEASE``)
230267
take no effects when generating a defconfig.
231268

232-
Modify the hypervisor configurations
233-
************************************
234-
235269
To modify the hypervisor configurations, you can either edit ``.config``
236270
manually, or invoke a TUI-based menuconfig, powered by kconfiglib, by executing
237271
``make menuconfig``. As an example, the following commands, assuming that you
238272
are under the top-level directory of acrn-hypervisor, generate a default
239273
configuration file for UEFI, allow you to modify some configurations and build
240274
the hypervisor using the updated ``.config``.
241275

242-
.. code-block:: none
276+
.. code-block:: none
243277
244-
$ cd hypervisor
245-
$ make defconfig BOARD=nuc6cayh
246-
$ make menuconfig # Modify the configurations per your needs
247-
$ make # Build the hypervisor with the new .config
278+
$ make menuconfig # Modify the configurations per your needs
248279
249-
.. note::
250-
Menuconfig is python3 only.
280+
.. note::
281+
Menuconfig is python3 only.
251282

252283
Refer to the help on menuconfig for a detailed guide on the interface.
253284

254-
.. code-block:: none
285+
.. code-block:: none
255286
256-
$ pydoc3 menuconfig
287+
$ pydoc3 menuconfig
257288
258-
Create a new default configuration
259-
**********************************
289+
Build the hypervisor, device model and tools
290+
********************************************
291+
292+
Now you can build all these components in one go as follows:
293+
294+
.. code-block:: none
295+
296+
$ cd ../ # Enter top-level folder of acrn-hypervisor source
297+
$ make FIRMWARE=uefi # Build the UEFI hypervisor with the new .config
298+
299+
The build results are found in the ``build`` directory. You can specify
300+
use a different Output folder by setting the ``O`` make parameter,
301+
for example: ``make O=build-nuc BOARD=nuc6cayh``.
302+
303+
If you only need the hypervisor, then use this command:
304+
305+
.. code-block:: none
306+
307+
$ make clean # Remove files previously built
308+
$ make FIRMWARE=uefi hypervisor # This will only build the hypervisor
309+
310+
You could also use ``FIRMWARE=sbl`` instead, to build the Intel SBL
311+
(`Slim bootloader
312+
<https://www.intel.com/content/www/us/en/design/products-and-solutions/technologies/slim-bootloader/overview.html>`_)
313+
hypervisor.
314+
315+
Follow the same instructions to boot and test the images you created from your build.
316+
317+
Save as default configuration
318+
*****************************
260319

261320
Currently the ACRN hypervisor looks for default configurations under
262321
``hypervisor/arch/x86/configs/<BOARD>.config``, where ``<BOARD>`` is the
@@ -277,4 +336,3 @@ example above) to 'BOARD=':
277336
.. code-block:: none
278337
279338
$ make defconfig BOARD=xxx
280-
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
digraph G {
2+
rankdir=LR;
3+
bgcolor="transparent";
4+
UEFI -> "GRUB" -> "acrn.32.out" -> "Pre-launched\nVM Kernel"
5+
"acrn.32.out" -> "Service VM\nKernel" -> "ACRN\nDevice Model" ->
6+
"Virtual\nBootloader";
7+
}

doc/introduction/index.rst

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,22 +137,51 @@ and many other features.
137137
Boot Sequence
138138
*************
139139

140+
ACRN supports two kinds of boots: **De-privilege boot mode** and **Direct
141+
boot mode**.
142+
143+
De-privilege boot mode
144+
======================
145+
146+
**De-privilege boot mode** is loaded by ``acrn.efi`` under a UEFI
147+
environment. The Service VM must be the first launched VM, (i.e. VM0).
148+
140149
In :numref:`boot-flow` we show a verified Boot Sequence with UEFI
141150
on an Intel Architecture platform NUC (see :ref:`hardware`).
142151

143152
.. graphviz:: images/boot-flow.dot
144153
:name: boot-flow
145154
:align: center
146-
:caption: ACRN Hypervisor Boot Flow
155+
:caption: ACRN Hypervisor De-privilege boot mode Flow
147156

148157
The Boot process proceeds as follows:
149158

150-
#. UEFI verifies and boots the ACRN hypervisor and Service OS Bootloader
151-
#. UEFI (or Service OS Bootloader) verifies and boots Service OS kernel
152-
#. Service OS kernel verifies and loads ACRN Device Model and Virtual
159+
#. UEFI verifies and boots the ACRN hypervisor and Service VM Bootloader
160+
#. UEFI (or Service VM Bootloader) verifies and boots Service VM kernel
161+
#. Service VM kernel verifies and loads ACRN Device Model and Virtual
153162
bootloader through dm-verity
154163
#. Virtual bootloader starts the User-side verified boot process
155164

165+
Direct boot mode
166+
================
167+
168+
In :numref:`boot-flow-2` we show the **Direct boot mode** sequence:
169+
170+
.. graphviz:: images/boot-flow-2.dot
171+
:name: boot-flow-2
172+
:align: center
173+
:caption: ACRN Hypervisor Direct boot mode Boot Flow
174+
175+
The Boot process proceeds as follows:
176+
177+
#. UEFI boots GRUB
178+
#. GRUB boots the ACRN hypervisor and loads the VM kernels as Multi-boot
179+
modules
180+
#. ACRN hypervisor verifies and boots kernels of the Pre-launched VM and
181+
Service VM
182+
#. In the Service VM launch path, the Service VM kernel verifies and loads
183+
the ACRN Device Model and Virtual bootloader through dm-verity
184+
#. Virtual bootloader starts the User-side verified boot process
156185

157186
ACRN Hypervisor Architecture
158187
****************************

doc/try.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Try using ACRN
66
After reading the :ref:`introduction`, use these guides to get started
77
using ACRN in a reference setup. We'll show how to set up your
88
development and target hardware, and then how to boot up the ACRN
9-
hypervisor and the `Clear Linux`_ Service OS and Guest OS on the Intel
9+
hypervisor and the `Clear Linux`_ Service VM and User VM on the Intel
1010
(EFI) platform.
1111

1212
.. _Clear Linux: https://clearlinux.org

0 commit comments

Comments
 (0)