一座逝去的里程碑VxWorks2Linux

来源:互联网 发布:最新手机cpa诱导源码 编辑:程序博客网 时间:2024/04/29 03:15

曾今有幸从事过VxWorks到Linux系统的应用层代码移植,也没有总结过。只有涉及大量存量代码的公司才会存在该问题,而实际情况证明,即使有百万行代码的公司,也会借助这种契机剥离API的依赖。

VxWorks和Linux最大的区别在于一个是实时操作系统,一个是非实时或者软实时的操作系统。即使变种的RT-Linux也并非是高精度实时系统的首选。另外,Vxworks是单态多任务的系统;Linux存在用户态和核心态的严格权限区分,用户态支持多进程多线程模式。


当初在进行验证性移植的时候,接触了v2lin的项目,通过该中间层,VxWorks上的代码只要经过简单的gcc编译器兼容性要求的代码修改就能运行在Linux环境下。同时,正像v2lin团队所说的v2lin支持POSIX-compilant glibc,并很好的运行了大部分的Vxworks上的代码,但也有一些pthread方面的问题,这个问题导致很头疼的信号不是发给特定线程的,不像VxWork将信号发给特定任务。所以这层v2lin中间件的项目就无法很好的进行下去。个人感觉更多的还是需要VxWorks和Linux差异兼容性方面的协调,而Linux已经发展成自己的一套标准体系,要和VxWorks去协调显然也存在沟通和协调成本。


总的来说,当前的环境下,这些实现的可能性比较低,所以有了v2lin小组的下面发言“目前没有更新的计划”,事实证明v2lin项目已经停滞了很长的事件,也是VxWorks2Linux中间件移植的一座逝去的里程碑。在此,也纪念缅怀一下v2lin项目。


v2lin is a fork of outdated legacy2linux/v2linux project. v2lin supports recent POSIX-compliant glibc. If you port your application from VxWorks to GNU/Linux, this library will help you a lot. v2lin provides VxWorks compliant API for tasks, semaphores, message queues, etc.We started porting our VxWorks applications to Linux and found several differences between the two systems which require some kind of adatation layer (middleware) to run our applications on Linux, otherwise we had to redesign our application and change many APIs we already use.We found that v2linux can solve some of our problems, however we noticed that there were no updates since 2001.We did some source code research, made several changes and eventually succeed to compile it and run the validate program attached with the library code.Most of the tests performed well, however some tests failed because of obsolete assumptions concerning Linux behavior made in v2linux. For example thread suspension will not work the way it is implemented in v2linux, since in current pthread library implementation (NPTL) SIGSTOP always sent to a whole process and not to specific thread.There are several additional issues that has to be covered before v2linux can be used to the fullest extent with current linux/gnu toolchains implementations.During our v2linux research we studied its code and made some changes. We have an intention to perform additional changes.We would like to contribute our current and future changes to the v2linux project, since we noticed that there are many projects involved in porting their legacy applications from VxWorks to Linux these days. And they desire an updated version of library like v2linux.Since there are no plans for updates of original v2linux project in the near future, we created v2lin. We hope that our contribution will be useful.v2lin team