hypervisor相关的知识点

1、QNX网站

http://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.hypervisor.safety.user/topic/virt/pdevs.html

2、guest os之间的通信方式

shared-memory

Memory sharing

Guests in a hypervisor system can share memory regions through which they can pass data to each other.

In a QNX Hypervisor system, client applications running in guests create and manage shared memory, and can use shared memory regions to share data. If data needs to be shared between a guest or guests and the hypervisor host domain, applications running in the hypervisor host domain can also create shared memory regions, or attach to regions created by guests.

Assuming that all sharing is between guests, and not with the hypervisor host, to set up memory sharing in your hypervisor system:

  1. Edit the qvm configuration files (*.qvmconf) for the VMs hosting the guests that will share memory to enable shared memory services (see “Configuring the VMs” below).
  2. Create a client application that runs in the guests and uses shared memory services, and run it on multiple guests.

The hypervisor-shmem-examples-march31.tgz archive available in the QNX Hypervisor package includes source code for example memory sharing programs: ghstest.c for a QNX guest, and for the hypervisor host.

The binaries for a QNX Neutrino OS 7.0 guest are included in the hypervisor files. If you want to try this shared memory program with a QNX Neutrino OS 6.6 guest, you can download and unpack the example program binary files (see “Additional files for QNX Neutrino OS 6.6 guests” in the “Assembling a Hypervisor System and Its Components” chapter).

How shared memory works

To use shared memory, a client (an application running in a guest or in the hypervisor host) needs:

  • a mapping of the shared memory region
  • a hardware interrupt it can use to signal other users of the shared memory regions that this region has been updated

The hypervisor includes the vdev-shmem vdev, which implements setting up the shared memory mapping and the interrupts you need to use shared memory. This vdev provides additional functionality to simplify using shared memory. These include:

  • shared memory region names (a hypervisor system may include multiple named shared regions)
  • selective signaling (e.g., signal Guest 0, but not Guest 3)
  • signal knowledge (the ability to know which guests have been signaled)

The figure below illustrates memory sharing between two guests. Guest 0 attempts to attach to a 128 MB shared memory area first. Since no such area exists at the specified location, the attempt to attach creates the area and allows the guest to attach to it. Guest 1 can simply attach to the same name to share data memory with Guest 0.

 Figure 1. A 128 MB memory allocation shared by Guest 0 and Guest 1

For more information about shared memory regions, see “Factory and control pages” below.

All the connections to a shared memory region are peers. That is, there is no distinction between the guest that creates a shared memory region and the guest that attaches to it. Simply, the first attempt to attach to a shared memory region creates the region. As far as the guest is concerned, it simply attaches to the region.

This design avoids ordering problems where the system designer would have to make sure that one guest always comes up and creates the shared memory region before another guest tries to attach to it.


 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值