Skip to content

Commit b6cb351

Browse files
docs: virtio: add section about available drivers and samples
This commit adds sections to the virtio docs with the currently supported transfer methods, drivers and samples Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
1 parent b589797 commit b6cb351

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

doc/hardware/virtualization/virtio.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,31 @@ virtqueue has to be acquired using :c:func:`virtio_get_virtqueue`. To send data
123123
will be invoked once the device returns the given descriptor chain. After that, the virtqueue has to be notified using
124124
:c:func:`virtio_notify_virtqueue` from the Virtio API.
125125

126+
Guest-side Virtio drivers
127+
*************************
128+
Currently Zephyr provides drivers for Virtio over PCI and Virtio over MMIO and drivers for two devices using virtio - virtiofs, used
129+
to access the filesystem of the host and virtio-entropy, used as an entropy source.
130+
131+
Virtiofs
132+
=========
133+
This driver provides support for `virtiofs <https://virtio-fs.gitlab.io/>`_ - a filesystem allowing a virtual machine guest to access
134+
a directory on the host. It uses FUSE messages to communicate between the host and the guest in order to perform filesystem operations such as
135+
opening and reading files. Every time the guest wants to perform some filesystem operation it places in the virtqueue a descriptor chain
136+
starting with the device readable part, containing the FUSE input header and input data, and ending it with the device writeable part, with place
137+
for the FUSE output header and output data.
138+
139+
Virtio-entropy
140+
==============
141+
This driver allows using virtio-entropy as an entropy source in Zephyr. The operation of this device is simple - the driver places a
142+
buffer in the virtqueue and receives it back, filled with random data.
143+
144+
Virtio samples
145+
**************
146+
A sample showcasing the use of a driver relying on Virtio is provided in :zephyr:code-sample:`virtiofs`. If you wish
147+
to check code interfacing directly with the Virtio driver, you can check the virtiofs driver, especially :c:func:`virtiofs_init`
148+
for initialization and :c:func:`virtiofs_send_receive` with the :c:func:`virtiofs_recv_cb` for data transfer to/from
149+
the Virtio device.
150+
126151
API Reference
127152
*************
128153

0 commit comments

Comments
 (0)