qnx的网络知识记录
qnx的网络记录
1、网络驱动加载
使用mount挂载io-pkt模块
mount -Tio-pkt /lib/dll/devnp-e1000.so
nicinfo 命令可以查看网卡的各种状态,包括phy的状态
2、iopkt
iopkt的介绍,包括bpf
3、vdevpeer
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
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:
-
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.
-
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.
-
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:
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
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐



所有评论(0)