mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 05:30:24 +00:00
doc: tweak vUART tutorial for improved rendering
Tweak the "vUART configuration" tutorial to fix a few typos and change some formatting to improve its readability. Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
parent
698ec4c4f4
commit
76da81370b
@ -8,7 +8,7 @@ Introduction
|
||||
|
||||
The virtual universal asynchronous receiver-transmitter (vUART) supports two functions: one is the console, the other is communication. vUART only works on a single function.
|
||||
|
||||
Currently, only two vUARTs configurations are added to the `/hypervisor/scenarios/<xxx>/vm_configuration.c` file, but you can change the value in it.
|
||||
Currently, only two vUART configurations are added to the ``hypervisor/scenarios/<xxx>/vm_configuration.c`` file, but you can change the value in it.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
@ -48,7 +48,7 @@ Console enable list
|
||||
How to configure a console port
|
||||
===============================
|
||||
|
||||
To enable the console port for a VM, change only the port_base and irq. If the irq number has been used in your system (`cat /proc/interrupt`), choose another irq number. If you set the .irq =0, the vuart will work in polling mode.
|
||||
To enable the console port for a VM, change only the ``port_base`` and ``irq``. If the irq number is already in use in your system (``cat /proc/interrupt``), choose another irq number. If you set the ``.irq =0``, the vuart will work in polling mode.
|
||||
|
||||
- COM1_BASE (0x3F8) + COM1_IRQ(4)
|
||||
- COM2_BASE (0x2F8) + COM2_IRQ(3)
|
||||
@ -68,9 +68,9 @@ Example:
|
||||
How to configure a communication port
|
||||
=====================================
|
||||
|
||||
To enable the communication port, configure vuart[1] in the two VMs that want to communicate.
|
||||
To enable the communication port, configure ``vuart[1]`` in the two VMs that want to communicate.
|
||||
|
||||
The port_base and irq should not repeat with the vuart[0] in the same VM.
|
||||
The port_base and irq should differ from the ``vuart[0]`` in the same VM.
|
||||
|
||||
**t_vuart.vm_id** is the target VM's vm_id, start from 0. (0 means VM0)
|
||||
|
||||
@ -123,7 +123,7 @@ Launch script
|
||||
=============
|
||||
|
||||
- *-s 1:0,lpc -l com1,stdio*
|
||||
This option is only needed for WaaG and vxWorks (and currently, OVMF). The common port is that they all depend on the ACPI table, but only acrn-dm can provide the ACPI table for UART.
|
||||
This option is only needed for WaaG and VxWorks (and also when using OVMF). They depend on the ACPI table, and only ``acrn-dm`` can provide the ACPI table for UART.
|
||||
|
||||
- *-B " ....,console=ttyS0, ..."*
|
||||
Add this to the kernel-based system.
|
||||
@ -133,26 +133,26 @@ Test the communication port
|
||||
|
||||
After you have configured the communication port in hypervisor, you can access the corresponding port. For example, in Clear Linux:
|
||||
|
||||
1. With `echo` and `cat`
|
||||
1. With ``echo`` and ``cat``
|
||||
|
||||
On VM1: `# cat /dev/ttyS1`
|
||||
On VM1: ``# cat /dev/ttyS1``
|
||||
|
||||
On VM2: `# echo "test test" > /dev/ttyS1`
|
||||
On VM2: ``# echo "test test" > /dev/ttyS1``
|
||||
|
||||
you can find the message from VM1 `/dev/ttyS1`.
|
||||
you can find the message from VM1 ``/dev/ttyS1``.
|
||||
|
||||
If you are not sure which port is the communication port, you can run "dmesg | grep ttyS" under the Linux shell to check the base address. If it matches what you have set in the `vm_configuration.c` file, it is the correct port.
|
||||
If you are not sure which port is the communication port, you can run ``dmesg | grep ttyS`` under the Linux shell to check the base address. If it matches what you have set in the ``vm_configuration.c`` file, it is the correct port.
|
||||
|
||||
|
||||
#. With mimicom
|
||||
#. With minicom
|
||||
|
||||
Run `minicom -D /dev/ttyS1` on both VM1 and VM2 and enter `test` in VM1's minicom. The message should appear in VM2's minicom. Close the flow control in minicom.
|
||||
Run ``minicom -D /dev/ttyS1`` on both VM1 and VM2 and enter ``test`` in VM1's minicom. The message should appear in VM2's minicom. Disable flow control in minicom.
|
||||
|
||||
|
||||
#. Limitations
|
||||
|
||||
- The msg can not longer than 256 bytes.
|
||||
- This cannot be used to transfer files because flow control is not supported so data may lost.
|
||||
- The msg cannot be longer than 256 bytes.
|
||||
- This cannot be used to transfer files because flow control is not supported so data may be lost.
|
||||
|
||||
vUART design
|
||||
============
|
||||
@ -169,18 +169,18 @@ vUART design
|
||||
:align: center
|
||||
:name: communication-vuart
|
||||
|
||||
Com port configurations for Post-Launched VMs
|
||||
COM port configurations for Post-Launched VMs
|
||||
=============================================
|
||||
|
||||
For a post-launched VM, the acrn-dm cmdline also provides a com port configuration:
|
||||
For a post-launched VM, the ``acrn-dm`` cmdline also provides a COM port configuration:
|
||||
|
||||
`-s 1:0,lpc -l com1,stdio`
|
||||
``-s 1:0,lpc -l com1,stdio``
|
||||
|
||||
This adds com1(0x3f8) and com2(0x2f8) modules in the Guest VM, including the ACPI info for these two ports.
|
||||
This adds ``com1 (0x3f8)`` and ``com2 (0x2f8)`` modules in the Guest VM, including the ACPI info for these two ports.
|
||||
|
||||
**Data Flow 1:**
|
||||
|
||||
When the Post-launched VM is started only with the vUART enabled in the hypervisor configuration file, the data flow is shown as below:
|
||||
When the post-launched VM is started with the vUART enabled in the hypervisor configuration file only, the data flow is shown as below:
|
||||
|
||||
.. figure:: images/vuart-config-3.png
|
||||
:align: center
|
||||
@ -198,13 +198,13 @@ When the Post-launched VM is started only with the vUART enabled in the hypervis
|
||||
|
||||
**Data Flow 2:**
|
||||
|
||||
When the Post-launched VM is started only with the acrn-dm cmdline of `-s 1:0,lpc -l com1,stdio`, the data flow is shown as below:
|
||||
When the post-launched VM is started with the ``acrn-dm`` cmdline of ``-s 1:0,lpc -l com1,stdio`` only, the data flow is shown as below:
|
||||
|
||||
.. figure:: images/vuart-config-4.png
|
||||
:align: center
|
||||
:name: PLVM2-vuart
|
||||
|
||||
**acrn-dm cmdline:** `-s 1:0,lpc -l com1,stdio`
|
||||
**acrn-dm cmdline:** ``-s 1:0,lpc -l com1,stdio``
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
@ -215,13 +215,13 @@ When the Post-launched VM is started only with the acrn-dm cmdline of `-s 1:0,lp
|
||||
|
||||
**Date Flow 3:**
|
||||
|
||||
When the Post-launched VM is started with both vUART enabled and the acrn-dm cmdline of `-s 1:0,lpc -l com1,stdio`, the data flow is show as below:
|
||||
When the post-launched VM is started with both vUART enabled and the ``acrn-dm`` cmdline of ``-s 1:0,lpc -l com1,stdio``, the data flow is show as below:
|
||||
|
||||
.. figure:: images/vuart-config-5.png
|
||||
:align: center
|
||||
:name: PLVM3-vuart
|
||||
|
||||
**acrn-dm cmdline:** `-s 1:0,lpc -l com1,stdio`
|
||||
**acrn-dm cmdline:** ``-s 1:0,lpc -l com1,stdio``
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
@ -232,6 +232,6 @@ When the Post-launched VM is started with both vUART enabled and the acrn-dm cmd
|
||||
},
|
||||
|
||||
.. note::
|
||||
For operating systems such as vxWorks and Windows that depend on the ACPI table to probe the uart driver, only adding the vuart configuration in the hypervisor is not enough. Currently, we recommend that you use the configuration in Data Flow 3. This may be refined in the future.
|
||||
For operating systems such as VxWorks and Windows that depend on the ACPI table to probe the uart driver, adding the vuart configuration in the hypervisor is not sufficient. Currently, we recommend that you use the configuration in Data Flow 3. This may be refined in the future.
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user