vxsim 配置虚拟网卡(进行网络编程,配置方法增加了说明)

配置vxsim虚拟网卡

1. 首先要安装虚拟网卡,方法:
   控制面板->

   添加硬件->

   已经连接了此硬件->

   选择添加新的硬件设备>

   安装我手动从列表选择的硬件->

   选择网络适配器->

   从磁盘安装->

   选择tornado2.2安装目录\host\x86-win32\bin里的netULIP.inf

   安装即可。
   安装完毕后要进行配置网卡IP,例如ip地址设置为192.168.10.110,子网掩码为255.255.255.0、在wins页选择禁用 TCP/IP上的NETBIOS


  
2、 configure target server:tool->configure target servers
    new一个target server出来,

    地址上面设置的netULIP虚拟网卡ip地址(192.168.10.110),

    available back选wdbrpc,
    core file and symbolsystem选生成的vxworks.exe位置处,
    memory catch size选specify 2000。
    target name/ip address填192.168.10.1 (上面虚拟网卡设置同一网段的)


3、修改tornado2.2安装目录:

必需条件:
Tornado中的simulator必须是full simulator,full simulator具有integrated simulator(可在Tornado 点 Help->About->Details查看,在安装Tornado的时候也能查看)所有的功能,而且还能进行网络仿真,至于安装的是哪一个simulator是由License决定的。

3.1、启动Routing and Remote Access这个服务,并将该服务设为自动启动;

3.2、修改tornado\target\config\simpc\config.h
#if FALSE /* ---->将原先的TRUE改成FALSE */
#undef INCLUDE_NETWORK
#undef INCLUDE_NET_INIT
#undef WDB_COMM_TYPE
#define WDB_COMM_TYPE WDB_COMM_PIPE
#undef WDB_TTY_TEST
#else /* !TRUE */
#define INCLUDE_END
#undef INCLUDE_WDB_SYS /* system mode not supported on full simulator */
#undef WDB_MODE
#define WDB_MODE WDB_MODE_TASK /* do not allowtch to system mode */
#endif /* TRUE */;

3.3、新建一个Bootable的工程,BSP选为simpc,然后编译, 如果你想检验一下网络功能,可在workspace的vxworks页的network components->networking protocols->network applications->ping client点右键include ping client,重新build;

3.4、Launch simulator,选择custom-built simulator,浏览选中刚才编译出来的vxworks.exe,processor no.设为0(full simulator可支持16个simulator,并且能够互相通信,它们的processor no.分别是0-15),确定;

3.5、 Launch target server,关闭"Launch simulator"后会提示你"launch target server",---->点Details,选中Full simulator,修改上面的命令行参数,将C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/tsfs改为系统中 存在的目录,点OK启动"target server",然后你可以双击窗口右下方的target server图标查看启动情况;当然你也可以通过Tornado菜单(Tools->target server->configure)进行target server的配置并启动它; 

3.6、如果Target server启动成功,你点launch shell启动一个shell,输入 “ping "host's ip",5”,回车,ping通了就说明网络仿真已经成功;

/*下面步骤重要,注意别忘记执行如下命令*/
3.7、(win32) 本机(pc1)192.168.1.100的vxsim与其它主机(pc2)192.168.1.101的通信:如果本机pc1的vxsim 要和局域网内pc2 socket通讯,只需在pc2的路由表中增加一项:route add 192.168.255.1 192.168.1.100 metric 1

(linux)  route -nv add 192.168.255.1 gw 192.168.1.100 dev eth0 metric 1

注意:192.168.255.1这个ip不固定,启动模拟器时,系统会给他分配(192.168.255.1~192.168.255.16)范围内的IP地址,我理解的对不对?


然后可在pc2上::ping host1上vmsim模拟器的ip 192.168.255.1 和

           在pc1的simulator上:: ping 192.168.1.101进行验证;



//下面的组件在tornado的workspace 工作区下面的vxworks tab页里配置,引入下面包

4. vxworks组件配置(include表示需要右键include该组件,only include表示该展开项下只包含该组件):
   development tool component 
       -target shell component(include)
    -WDB agent component 
        -select WDB connection
            -WDB END driver connectioin(only include)
        -select WDB mode 
            -WDB task debugging(only include)                
    -show routines   // 如果需要可再添加其他的show routine
        -memory show routine(include)
        -semaphore show routine(include)
        -symbol table show routine(include)  

   network components  
       -networking protocols
           -network debugging
               -ICMP show routines(include)
               -IGMP show routines(include)
 
    -network application
         -PING client(include) //增加了此组件,在i shell环境下,通过ping "192.168.1.2",3  命令来执行3次ping 局域网内的计算机192.168.1.2。也可以和局域网内计算机sokcet通讯了
     -core TCP/IP components
               -ICMPv4(include)
               -IGMPv4(include)
   operating system 
       -IO system components
           -File System and Disk Utilities

 

转自:http://www.cnblogs.com/jxnclyk/archive/2011/10/15/2212832.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值