qnx的网络知识记录

1、网络驱动加载

http://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.core_networking/topic/drivers_Loading.html

使用mount挂载io-pkt模块

mount -Tio-pkt /lib/dll/devnp-e1000.so

nicinfo 命令可以查看网卡的各种状态,包括phy的状态

2、iopkt

iopkt的介绍,包括bpf

http://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.sys_arch/topic/net_Manager.html

3、vdevpeer

http://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.hypervisor.safety.user/topic/utils/devnp-vdevpeer-net.so.html

Guest-to-host

Configure a virtio-net vdev

The following excerpt shows the virtio-net vdev configuration in the *.qvmconf file for the VM hosting the guest.

For a QNX guest on an ARM board, configure a virtio-net vdev as follows:
system qnx71-arm-guest ... # The loc and intr gic options are for ARM only. The guest will see the # virtio-net vdev as a memory-mapped I/O device at the specified location. vdev virtio-net loc 0x1c0c0000 intr gic:40 mac aa:aa:aa:aa:aa:aa name p2p peer /dev/vdevpeers/vp0 peerfeats 0x3

http://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.hypervisor.user/topic/network/guest2host.html

Description:

The devnp-vdevpeer-net.so driver enables an io-pkt-* networking manager running in the host to communicate with virtual network devices configured for guests. The driver works with both the io-pkt-v4-hc and io-pkt-v6-hc stack variants. It is used for peer-to-peer communication between the hypervisor host and guests, and can be used to facilitate communication between guests and the outside world, by enabling a bridge running in the host's networking manager to connect guests to the outside world.

To use the devnp-vdevpeer-net.so driver to set up peer-to-peer communication in a hypervisor system and with the outside world:

  1. In the hypervisor host, start io-pkt-*, specifying the devnp-vdevpeer-net.so driver, and using the driver options to configure the node in the hypervisor host: the connection path, the MAC address, the path to the node in the guest, and, optionally, a name for the node. For example:

io-pkt-v6-hc -d vdevpeer-net \

peer=/dev/qvm/vt1,bind=/pkt/vp0,mac=a0b0c0d0e0f0

where /dev/qvm/vt1 is the path of the peer to communicate with, /pkt/vp0 is the path to the peer node (the guest), and a0b0c0d0e0f0 is this peer node's MAC address.

  1. Configure the IP address of the peer node; for example:

ifconfig vp0 192.0.2.1

where vp0 is the peer node, and 192.0.2.1 is its IP address.

  1. In the qvm configuration file for the VM that will host the guest, configure the virtio-net vdev (see “vdev virtio-net” in the “Virtual Device Reference” chapter).

可以通过.qvmconfig配置文件配置vdevpeer:

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

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

4、8155双系统中的qnx配置

QNX/qnx_ap/target/hypervisor/host/startup.qvmhost.tmpl

https://download.csdn.net/download/yudelian/87472378

这儿会根据Guest的类型挂载io-pkt,绑定不同的vdevpeer,我的车机系统只绑定了vp0

在这儿,qnx创建一个bridge0, 将vp0加入,并且将emac0加入,形成一个网桥二层网络

这儿还可以通过devc-quipv3设置 uart启动之类的

echo $(nsec)"mount -T io-pkt"
#if defined(__GUEST_TYPE_LA__) 
mount -T io-pkt -o peer=/dev/qvm/la/la_to_host,bind=/dev/vdevpeer/vp0,mac=aaaaaaaaaaaa,mode=0660 /lib/dll/devnp-vdevpeer-net.so
 
#elif defined(__GUEST_TYPE_FDN__)
echo $(nsec)"mount -T io-pkt -o peer=/dev/qvm/la/la_to_host"
mount -T io-pkt -o peer=/dev/qvm/la/la_to_host,bind=/dev/vdevpeer/vp0,mac=aaaaaaaaaaaa /lib/dll/devnp-vdevpeer-net.so
mount -T io-pkt -o peer=/dev/qvm/lv/agl_to_host,bind=/dev/vdevpeer/vp1,mac=aaaaaaaaaaa1  /lib/dll/devnp-vdevpeer-net.so
mount -T io-pkt -o peer=/dev/qvm/qnx_1/qnx_to_host,bind=/dev/vdevpeer/vp2,mac=aaaaaaaaaaa2 /lib/dll/devnp-vdevpeer-net.so
 
#else
echo $(nsec)"mount -T io-pkt -o peer=/dev/qvm/la/la_to_host"
mount -T io-pkt -o peer=/dev/qvm/la/la_to_host,bind=/dev/vdevpeer/vp0,mac=aaaaaaaaaaaa /lib/dll/devnp-vdevpeer-net.so
mount -T io-pkt -o peer=/dev/qvm/lv/agl_to_host,bind=/dev/vdevpeer/vp1,mac=aaaaaaaaaaa1  /lib/dll/devnp-vdevpeer-net.so
#endif


#if defined(__GUEST_TYPE_LA__) 
if [ $SECPOL_ENABLE -eq 1 ];then
    on -T ifconfig_t -u IFCONFIG_UID:IFCONFIG_GID ifconfig vp0 up
    on -T ifconfig_t -u IFCONFIG_UID:IFCONFIG_GID ifconfig bridge0 create
    brconfig bridge0 add vp0 up
else
    ifconfig vp0 up
    ifconfig bridge0 create
    brconfig bridge0 add vp0 up
fi


echo $(nsec)"brconfig bridge0 add emac0 up"
brconfig bridge0 add emac0 up
ifconfig emac0 172.20.0.34/24 up
route add default 172.20.0.40

ifconfig vlan3 create
if_up -p vlan3
ifconfig vlan3 vlan 3 vlanif emac0
ifconfig vlan3 172.20.3.34/24 up

QNX/qnx_ap/ target/hypervisor/host/build_files/system.build.tmpl

这个文件应该可以配置uart、spi、中断号等

vdev vdev-virtio-net.so loc 0x1c0c0000 intr gic:41 peer /dev/vdevpeer/vp0 mac aa:bb:cc:dd:ee:23 name la_to_host

//这儿感觉是通过qvm加载配置,暂时也不太清楚
//代码里没找到/vm/images/linux-la.config, 但是在qnx运行系统里有
[uid=0 gid=0 perms=555] bin/runla={
dtach -A /tmp/la_1 -r winch qvm @/vm/images/linux-la.config
  • 0
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值