This project involved not only porting to an RTOS such as VxWorks but also targeting an embedded system. This required the following knowledge to have:
- VxWorks is a very particular real-time operating system, and it requires a BSP for the target hardware
- For an RTOS, determinism is fundamental. POSIX, for example, determines that for clock_gettime() to be POSIX compliant a call to clock_settime() should be done beforehand but it does not specify where the time passed in to it needs to come from. It could come from an RTC chip (if the board has a Real-Time-Calendar chip, we can read it, convert its time to number of seconds and nanoseconds and then use that computed value in the clock_settime()), an SNTP Network Protocol, GPS, or any other time source, and then set accordingly at the BSP or application programmer levels.
- VxWorks kernel project creation for RTP (Real-Time Process, like Linux) and DKM (Kernel space) is required
- VxWorks/uBoot bootloaders need to also be compiled and configured, targeting the architecture.
- Knowing the CPU core, and not just the CPU, is fundamental here. We compile for performance, but also for wide compatibility. For example, in PowerPC, the e500 family is special, because some of the older models (namely, the e500v1 and e500v2) have an SPE unit instead of the regular PowerPC FPU (SPE = “Signal Processing Engine”). The SPE unit can be used to do some calculations in hardware that include signal processing and floating-point math, but is not IEEE 754 compliant, and it is incompatible with the PowerPC FPU.
The effort consisted in porting middleware code to generic PowerPC, to make the libraries available to as many as possible, yet tuning it for e500mc core. Being able to modify BSP to be POSIX compliant and follow through BSP and RTOS manuals and documentation as well as through the proper Support channels.
Debugged crashes in release libraries which were not happening in debug libraries. This required instrumentation of libraries, creation of engineering builds and use of GDB and Workbench.