VxWorks的压缩技术
在嵌入式系统中,我们通常会要求VxWorks文件尽量小,比如通过串口、软盘或tffs加载VxWorks的时候,如果文件太大,可能无法存储,或加载失败。下面介绍一种利用Tornado和VxWorks自带的deflate和inflate,对VxWorks文件进行压缩和解压缩的技术。希望对大家有所帮助:
1 使用Tornado创建bootable的project,包括应用程序。对VxWorks进行适当的裁减和配置。
2 如果准备将VxWorks存储于硬盘,软盘或tffs上,应该在usrAppInit中使用usrNetEndDevStart和
usrNetIfConfig启动网络接口。如果存储于tffs上,还要修改usrNetBoot.c中:
1 if ( (strncmp (sysBootParams.bootDev, "scsi", 4) == 0)
2 || (strncmp (sysBootParams.bootDev, "ide", 3) == 0)
3 || (strncmp (sysBootParams.bootDev, "ata", 3) == 0)
4 || (strncmp (sysBootParams.bootDev, "fd", 2) == 0))
5
2 || (strncmp (sysBootParams.bootDev, "ide", 3) == 0)
3 || (strncmp (sysBootParams.bootDev, "ata", 3) == 0)
4 || (strncmp (sysBootParams.bootDev, "fd", 2) == 0))
5
为:
1 if ( (strncmp (sysBootParams.bootDev, "scsi", 4) == 0)
2 || (strncmp (sysBootParams.bootDev, "ide", 3) == 0)
3 || (strncmp (sysBootParams.bootDev, "ata", 3) == 0)
4 || (strncmp (sysBootParams.bootDev, "tffs", 4) == 0)
5 || (strncmp (sysBootParams.bootDev, "fd", 2) == 0))
2 || (strncmp (sysBootParams.bootDev, "ide", 3) == 0)
3 || (strncmp (sysBootParams.bootDev, "ata", 3) == 0)
4 || (strncmp (sysBootParams.bootDev, "tffs", 4) == 0)
5 || (strncmp (sysBootParams.bootDev, "fd", 2) == 0))