I need to port a c/c++ codebase that already supports Linux/Mac, to VxWorks. I am pretty new to VxWorks. Could you let me know what are the possible issues that could arise?
我需要将已经支持Linux / Mac的c / c ++代码库移植到VxWorks。我对VxWorks很新。你能告诉我可能出现的问题吗?
4 个解决方案
#1
We recently did the opposite conversion - we ported code from a PowerPC machine running VxWorks to an Intel system running Linux. I don't remember hitting many snags as far as the differences between the operating systems. Obviously any call to an OS specific API will have to change and we were not making extensive use of these functions.
我们最近进行了相反的转换 - 我们将代码从运行VxWorks的PowerPC机器移植到运行Linux的Intel系统。我不记得在操作系统之间的差异方面遇到很多障碍。显然,对OS特定API的任何调用都必须改变,我们没有广泛使用这些函数。
Our biggest problem was not the difference between the operating systems, but rather the difference between PowerPC and Intel hardware. PowerPC is Big Endian and Intel is Little Endian. Our software is written in C and made many assumptions as to the order of bytes and this was an absolute nightmare to get it working smoothly again. There were literally hundreds of structures that defined bitfields and needed to be re-ordered to work correctly. We ended up implementing a #pragma in GCC that reversed these bitfields at their definition (#pragma reverse_bitfields).
我们最大的问题不是操作系统之间的差异,而是PowerPC和英特尔硬件之间的差异。 PowerPC是Big Endian,Intel是Little Endian。我们的软件是用C语言编写的,并且对字节顺序做了很多假设,这是让它再次顺利运行的绝对噩梦。实际上有数百种结构定义了位域,需要重新排序才能正常工作。我们最终在GCC中实现了#pragma,它们在定义时反转了这些位域(#pragma reverse_bitfields)。
#2
Much depends on which version of VxWorks you're targeting, and the actual target processor itself. One thing you will have to deal with is that there is no paged memory system or virtual memory--you have what's there. The environment itself is far more constrained than a linux system. Sometimes the work involved in porting applications goes all the way back to the architecture level because resources are not as unlimited as they are in linux.
在很大程度上取决于您要定位的VxWorks版本以及实际的目标处理器本身。你需要处理的一件事是没有分页内存系统或虚拟内存 - 你有什么东西。环境本身比Linux系统更受限制。有时,移植应用程序所涉及的工作会一直回到架构级别,因为资源不像linux中那样无限制。
Some other tips:
其他一些提示:
- license vxworks such that you have the source code available
- use a real, physical target as soon as possible in the development cycle; do not count on the simulators accurately emulating the target
- use TSRs (technical support requests) as necessary; I don't know how they structure the purchase of the right to create TSRs, but don't let anybody cheap out on these
许可证vxworks,以便您拥有可用的源代码
在开发周期中尽快使用真实的物理目标;不要指望模拟器准确地模拟目标
必要时使用TSR(技术支持请求);我不知道他们如何构建购买创建TSR的权利,但不要让任何人在这些方面做出便宜
#3
Depending on what processor you are running with VxWorks endianness, structure packing, and memory alignment could all be issues. The last time I used VxWorks it supported a pthreads, sockets, and mutex layer that mimicked the unix environments easily enough.
根据您使用VxWorks字节序运行的处理器,结构打包和内存对齐都可能是问题。我最后一次使用VxWorks时,它支持pthreads,socket和mutex层,足以轻松模仿unix环境。
#4
It's difficult to tell, without knowing more about the application that you're porting: What linux libraries and api calls does it use? Is it self-contained, or does it rely on slews of linux command-line tools and scripts to do its job?
在不了解您正在移植的应用程序的情况下很难说:它使用了什么linux库和api调用?它是独立的,还是依靠大量的linux命令行工具和脚本来完成它的工作?
As Average says, endianness can cause you way more problems than you expect - particularly if you're not prepared for it.
正如平均所说,字节序可能会导致比预期更多的问题 - 特别是如果你没有做好准备。
#1
We recently did the opposite conversion - we ported code from a PowerPC machine running VxWorks to an Intel system running Linux. I don't remember hitting many snags as far as the differences between the operating systems. Obviously any call to an OS specific API will have to change and we were not making extensive use of these functions.
我们最近进行了相反的转换 - 我们将代码从运行VxWorks的PowerPC机器移植到运行Linux的Intel系统。我不记得在操作系统之间的差异方面遇到很多障碍。显然,对OS特定API的任何调用都必须改变,我们没有广泛使用这些函数。
Our biggest problem was not the difference between the operating systems, but rather the difference between PowerPC and Intel hardware. PowerPC is Big Endian and Intel is Little Endian. Our software is written in C and made many assumptions as to the order of bytes and this was an absolute nightmare to get it working smoothly again. There were literally hundreds of structures that defined bitfields and needed to be re-ordered to work correctly. We ended up implementing a #pragma in GCC that reversed these bitfields at their definition (#pragma reverse_bitfields).
我们最大的问题不是操作系统之间的差异,而是PowerPC和英特尔硬件之间的差异。 PowerPC是Big Endian,Intel是Little Endian。我们的软件是用C语言编写的,并且对字节顺序做了很多假设,这是让它再次顺利运行的绝对噩梦。实际上有数百种结构定义了位域,需要重新排序才能正常工作。我们最终在GCC中实现了#pragma,它们在定义时反转了这些位域(#pragma reverse_bitfields)。
#2
Much depends on which version of VxWorks you're targeting, and the actual target processor itself. One thing you will have to deal with is that there is no paged memory system or virtual memory--you have what's there. The environment itself is far more constrained than a linux system. Sometimes the work involved in porting applications goes all the way back to the architecture level because resources are not as unlimited as they are in linux.
在很大程度上取决于您要定位的VxWorks版本以及实际的目标处理器本身。你需要处理的一件事是没有分页内存系统或虚拟内存 - 你有什么东西。环境本身比Linux系统更受限制。有时,移植应用程序所涉及的工作会一直回到架构级别,因为资源不像linux中那样无限制。
Some other tips:
其他一些提示:
- license vxworks such that you have the source code available
- use a real, physical target as soon as possible in the development cycle; do not count on the simulators accurately emulating the target
- use TSRs (technical support requests) as necessary; I don't know how they structure the purchase of the right to create TSRs, but don't let anybody cheap out on these
许可证vxworks,以便您拥有可用的源代码
在开发周期中尽快使用真实的物理目标;不要指望模拟器准确地模拟目标
必要时使用TSR(技术支持请求);我不知道他们如何构建购买创建TSR的权利,但不要让任何人在这些方面做出便宜
#3
Depending on what processor you are running with VxWorks endianness, structure packing, and memory alignment could all be issues. The last time I used VxWorks it supported a pthreads, sockets, and mutex layer that mimicked the unix environments easily enough.
根据您使用VxWorks字节序运行的处理器,结构打包和内存对齐都可能是问题。我最后一次使用VxWorks时,它支持pthreads,socket和mutex层,足以轻松模仿unix环境。
#4
It's difficult to tell, without knowing more about the application that you're porting: What linux libraries and api calls does it use? Is it self-contained, or does it rely on slews of linux command-line tools and scripts to do its job?
在不了解您正在移植的应用程序的情况下很难说:它使用了什么linux库和api调用?它是独立的,还是依靠大量的linux命令行工具和脚本来完成它的工作?
As Average says, endianness can cause you way more problems than you expect - particularly if you're not prepared for it.
正如平均所说,字节序可能会导致比预期更多的问题 - 特别是如果你没有做好准备。