Skip to content

Commit

Permalink
fix(doc): improve doc with detailed explanation of guest image load
Browse files Browse the repository at this point in the history
Signed-off-by: Diogo21Costa <[email protected]>
  • Loading branch information
Diogo21Costa committed Sep 12, 2023
1 parent 326d3bb commit a38a4a8
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions source/bao_hyp/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------------------
Expand All @@ -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 \
Expand Down

0 comments on commit a38a4a8

Please sign in to comment.