在Vx中配置好网卡及IP地址,并在程序中入口处启动网络,一般在vx5.5中,是这样的代码,并且编译的很好的:
ipAttach(0, "gei");
ifFlagSet( "gei0", IFF_UP);
ifAddrSet("gei0", "188.89.6.1");
在Vx6.6编译时,会出现找不到上面的函数,解决办法参见《Wind River Network Stack for VxWorks 6 Volume 1: Transport and Network Protocols》第39页:
另一种解决办法是:不在代码中完成这些功能,而是在BOOTLINE中,使用“o”参数完成,如:
"ata=0,0(0,0)host:/ata0a/vxWorks h=192.168.107.1 e=192.168.107.88 u=target pw=target
o=lnPci"
上述的启动设备是从硬盘启动,通过o参数加载了网卡,并且设置好了目标机的IP地址。