An OSPL emulates your RTOS APIs using Linux APIs. A well-written OSPL should minimize changes in your existing code base. In this section we discuss the structure of an OSPL. For this purpose we have defined our own RTOS APIs. These APIs are similar to APIs found in a traditional RTOS. We discuss task creation, task destruction, and mutex APIs. Our OSPL is a single library that links in both kernel and user space. The definitions are present in the file ospl.c. The ospl.h header file emulates RTOS datatypes using Linux datatypes. We discuss RTOS mutex APIs first as they have one-to-one mapping with Linux mutex APIs in our implementation. RTOS task APIs have one-to-many mapping with equivalent Linux APIs.
In this section we discuss OSPL for tasks that are implemented as threads in a Linux process. In Section 6.4.3 we show the mapping of timers and IPC APIs that can be used across Linux processes.
Was this article helpful?