Why POSIX for embedded systems?
A common problem with realtime application development is that each realtime OS tends to come equipped with its own proprietary API. In the absence of industry standards, this isn't an unusual state for a competitive marketplace to evolve into, since surveys of the realtime marketplace regularly show heavy use of in-house proprietary operating systems. POSIX represents a chance to unify this marketplace. Among the many POSIX standards, those of most interest to embedded systems developers are:
- 1003.1—defines the API for process management, device I/O, file system I/O, and basic IPC. This encompasses what might be described as the base functionality of a UNIX OS, serving as a useful standard for many applications. From a C-language programming perspective, ANSI X3J11 C is assumed as a starting point, and then the various aspects of managing processes, files, and tty devices are detailed beyond what ANSI C specifies.
- Realtime Extensions—defines a set of realtime extensions to the base 1003.1 standard. These extensions consist of semaphores, prioritized process scheduling, realtime extensions to signals, high-resolution timer control, enhanced IPC primitives, synchronous and asynchronous I/O, and a recommendation for realtime contiguous file support.
- Threads—further extends the POSIX environment to include the creation and management of multiple threads of execution within a given address space.
- Additional Realtime Extensions—defines further extensions to the realtime standard. Facilities such as attaching interrupt handlers are described.
- Application Environment Profiles—defines several AEPs (Realtime AEP, Embedded Systems AEP, and so on.) of the POSIX environment to suit different embedded capability sets. These profiles represent embedded OSs with/without file systems and other capabilities.
For information about the many POSIX drafts and standards, see the IEEE website at http://www.ieee.org/index.html .
Apart from any bandwagon motive for adopting industry standards, there are several specific advantages to applying the POSIX standard to the embedded realtime marketplace.
Multiple OS sources
Hardware manufacturers are loath to choose a single-sourced hardware component because of the risks implied if that source discontinues production. For the same reason, manufacturers shouldn't be tied to a single-sourced, proprietary OS simply because their application source code isn't portable to other OSs. By building applications to the POSIX standards, developers can use OSs from multiple vendors. Application source code can be readily ported from platform to platform and from OS to OS, provided that developers avoid using OS-specific extensions.
Portability of development staff
Using a common API for embedded development, programmers experienced with one realtime OS can directly apply their skill sets to other projects involving other processors and operating systems. In addition, programmers with UNIX or POSIX experience can easily work on embedded realtime systems, since the nonrealtime portion of the realtime OS's API is already familiar territory.
Development environment: native and cross development
With the addition of interface hardware similar to the target runtime system, a workstation running a POSIX OS can become a functional superset of the embedded system. As a result, the application can be conveniently developed on the self-hosted desktop system. Even in a cross-hosted development environment, the API remains essentially the same. Regardless of the particular host (BlackBerry 10 OS, Linux, Windows, and so on) or the target (x86, ARM), the programmer doesn't need to worry about platform-specific endian, alignment, or I/O issues.
Last modified: 2015-03-31