ARM, VMM and the run example

Stefan Kalkowski stefan.kalkowski at genode-labs.com
Mon Jan 18 13:03:27 CET 2021


Hello Peter,

On Fri, Jan 15, 2021 at 12:31:10PM +0000, fixed-term.peter.jacobi at sojus-software.de wrote:
> Hi,
> after trying to understand a little bit deeper at the "arm_vmm.run" file in an effort to expand this to run 2 VMMs parallel, I faced some issues I do not understand well. So I hope to get here your expert help to clarify what I missundersand.
> 1.- Arm-Run-File: I modified the vmm_arm.run adding a 2nd component vm2 as you can see in the attached file.
> The result of this you can see in the attached result-file.
> So no entry point is found for this 2nd component.

when looking into your example, I can see that you duplicated the
terminal_expect_send test-component only, but not the vmm (and thereby
vm), nor the terminal_crosslink component. Instead you connect the
additional terminal_expect_send component to the terminal_crosslink in
addition.

Before explaining what is going wrong, I'll explain the original
vmm_arm.run script in more detail, as well as the involved components.

The vmm_arm.script, like most run-scripts that are listed in
`tool/autopilot.list`, is used to automatically test every night a
certain feature. In this case, the ARM virtualization extensions resp.
our hypervisor and VMM. It is therefore not meant to be used
interactively. On the other hand, we want to test a bit of the
interactive features of the VMM, namely its virtio console model.
The virtio console model in the VMM maps to Genode's Terminal
interface. That means, the Terminal session route of the VMM
component can be used to interact with the guest VM's (Linux) console.
It is connected to the terminal_crosslink component. The
terminal_crosslink is a simple server component which connects the RX
line of one Terminal client with the TX line of another one and vice
versa. The other Terminal client, which is cross-linked with the VMM,
in this case is the terminal_expect_send component. This is a very
simple `expect`-like component, which looks for a certain string in
its Terminal input, and if it received that input sends another
string. In our example it is configured like the following:

  <config expect="/ #" send="ls" verbose="yes"/>

That means it waits for the terminal prompt "/ #", and then sends the
command "ls". Moreover, it prints all received characters to the LOG
output. Therefore, we cann see the interaction of terminal_expect_send
and VMM. That is also the reason, why the terminal_expect_send
components name is "vm", although it isn't actually the VM, because it
prints all console output of the VM to the LOG output. Therefore, an
observer looks at its output as the output of the VM. The VM itself is
not described discretely in the init configuration of the run-script.
It is always managed by the VMM.

To sum it up: if you want more than one VM, you need to start another
VMM. You should not connect more clients to the same
terminal_crosslink component than the two clients that should interact
with each other.

If you want to play around with the VMM in more detail. and learn more
about its interaction, I would recommend to you to replace the
terminal_expect_send and terminal_crosslink with a Terminal with whom
you can directly interact. Either you use networking and the
tcp_terminal, or you take a graphical environment as starting point
and start a Terminal that uses the GUI server.
If you simply want to duplicate the VM in the vmm_arm example, you
have to duplicate the VMM, terminal_crosslink, and
terminal_expect_send component as well.

> 2.- Source, wandering through the source structure /repos/os/src/ I found  the "terminal_expect_send" in the test directory. What do i expect to find in the os-test-directory structure?
> Greetings,
> Peter

In `src/test` in the sub-repositories in general, or in `os/src/test`
in particular, you'll find small components to e.g. showcase the
usage of an API, or to test-control a certain component. Those
components are typically not meant to be used as general-purpose,
productive components.

Best regards
Stefan


> _______________________________________________
> Genode users mailing list
> users at lists.genode.org
> https://lists.genode.org/listinfo/users


-- 
Stefan Kalkowski
Genode labs

https://github.com/skalk | https://genode.org



More information about the users mailing list