From a38a4a814092ae8ce9c324befde4a75315dad8eb Mon Sep 17 00:00:00 2001 From: Diogo21Costa Date: Tue, 12 Sep 2023 14:55:35 +0100 Subject: [PATCH] fix(doc): improve doc with detailed explanation of guest image load Signed-off-by: Diogo21Costa --- source/bao_hyp/config.rst | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/source/bao_hyp/config.rst b/source/bao_hyp/config.rst index 6ec9eeb..e6715ca 100644 --- a/source/bao_hyp/config.rst +++ b/source/bao_hyp/config.rst @@ -38,21 +38,27 @@ The configuration file follows a specific structure, as outlined below: } }; -Prior to defining the ``config`` struct, it is imperative to declare the VM -images. The declaration of VM images utilizes the VM_IMAGE macro, requiring an -identifier and the respective path to the image file. In this regard, the -configuration file expects to receive a compiled image of each guest -(``.bin`` file) that will be subsequently assigned to individual VMs using the -``VM_IMAGE`` macro. For instance, the number of VM images declared may vary -between 1 and the count of CPU cores accessible in the target platform, given -that the Bao hypervisor adheres to a 1-1 CPU partitioning policy. - -Afterward, the configuration allows the definition of two distinct lists: (i) a -list of shared memory regions (``shmemlist``) and (ii) a list of VMs (or -guests) (``vmlist``). While the list of shared memory regions is optional and -may be omitted from the configuration, the list of VMs is mandatory and must -include at least 1 VM. Additionally, for each list, it is necessary to specify -the list size using the parameters ``shmemlist_size`` and ``vmlist_size``. +Before defining the configuration struct, it's crucial to declare the VM +images. The configuration file anticipates receiving a compiled image of each +guest (.bin file) which will then be allocated to individual VMs using the +``VM_IMAGE`` macro. This macro allows for the direct embedding of the guest +binary file into the hypervisor binary file compiled program. Here's an example +usage of the ``VM_IMAGE``: + +.. code-block:: c + + VM_IMAGE(img_name, "/path/to/VM/binary.bin"); + +In this context, ``img_name`` is the identifier associated with the image that +will later be used to describe the image running on the VM - `Guest Image`_. + +After loading the images, the configuration allows the definition of two +distinct lists: (i) a list of shared memory regions (``shmemlist``) and (ii) a +list of VMs (or guests) (``vmlist``). While the list of shared memory regions +is optional and may be omitted from the configuration, the list of VMs is +mandatory and must include at least 1 VM. Additionally, for each list, it is +necessary to specify the list size using the parameters ``shmemlist_size`` and +``vmlist_size``. Config file name and location ----------------------------- @@ -64,7 +70,7 @@ designated ``configs`` directory. The build system then relies on this file to extract and apply the desired configuration options for the hypervisor. .. warning:: - Warning: Modifying the number of elements in the ``shmemlist`` or \ + Modifying the number of elements in the ``shmemlist`` or \ ``vmlist`` lists, which differs from the specified sizes \ (``shmemlist_size`` and ``vmlist_size``, respectively), may result in \ unpredictable behavior. Ensure that any changes made to the configuration \