NOTE: FreeRTOS-Plus-POSIX is a
FreeRTOS Labs project provided in the hope that it is useful. It is not a complete pthreads implementation, and does not necessary meet our production code quality standard. FreeRTOS-Plus-POSIX is provided in the
Lab-Project-FreeRTOS-POSIX repository on GitHub.
FreeRTOS-Plus-POSIX
Portable Operating System Interface (POSIX threading wrapper) for FreeRTOS
On this page:
- Introduction
- Pre-configured example project
- Supported features
- FreeRTOS-Plus-POSIX source code organisation
- Dependencies
- Developer references and API documentation
- Porting
- Code Size
Introduction
The Portable Operating System Interface (POSIX) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. FreeRTOS-Plus-POSIX implements a
small subset of the
POSIX threading API. This subset allows application developers familiar with POSIX API to develop a FreeRTOS application using POSIX like threading primitives. FreeRTOS-Plus-POSIX only implements about 20% of the POSIX API. Therefore, an existing POSIX compliant application or a POSIX compliant library cannot be ported to run on FreeRTOS Kernel using only this wrapper.
Location of FreeRTOS-Plus-POSIX when used with FreeRTOS libraries
Example Pre-configure Project
The FreeRTOS-Plus-POSIX pre-configured example is provided in a separate zip file download.
Currently Supported Features
FreeRTOS-Plus-POSIX partially implements IEEE Std 1003.1-2017 Edition The Open Group Technical Standard Base Specifications, Issue 7. FreeRTOS-Plus-POSIX includes implementations for the following POSIX threading header files - please refer to the FreeRTOS-Plus-POSIX API documentation for specifics on the features supported within each header file:
- errno.h
- fcntl.h
- mqueue.h
- pthread.h
- sched.h
- semaphore.h
|
- signal.h
- sys/types.h
- time.h
- unistd.h
- utils.h
|
FreeRTOS-Plus-POSIX Source Code Organisation
Porting related headers and implementation source code
/lib/FreeRTOS-Plus-POSIX
|-- include
| |
| +- FreeRTOS_POSIX.h
| +- FreeRTOS_POSIX_internal.h
| +- FreeRTOS_POSIX_types.h
| +- portable
| |
| +- [target]
| | |
| | +- [development board]
| | |
| | +- FreeRTOS_POSIX_portable.h
| |
| +- FreeRTOS_POSIX_portable_default.h
|
+- source
+- FreeRTOS_POSIX_clock.c
+- FreeRTOS_POSIX_mqueue.c
+- FreeRTOS_POSIX_pthread_barrier.c
+- FreeRTOS_POSIX_pthread.c
+- FreeRTOS_POSIX_pthread_cond.c
+- FreeRTOS_POSIX_pthread_mutex.c
+- FreeRTOS_POSIX_sched.c
+- FreeRTOS_POSIX_semaphore.c
+- FreeRTOS_POSIX_timer.c
+- FreeRTOS_POSIX_unistd.c
+- FreeRTOS_POSIX_utils.c
FreeRTOS-Plus-POSIX headers
/lib/include/FreeRTOS_POSIX
+- errno.h
+- fcntl.h
+- mqueue.h
+- pthread.h
+- sched.h
+- semaphore.h
+- signal.h
+- sys
| |
| +- types.h
|
+- time.h
+- unistd.h
+- utils.h
Dependencies
Both configUSE_POSIX_ERRNO and configUSE_APPLICATION_TASK_TAG must be set to 1 in FreeRTOSConfig.h.
Developer References and API Documents
Please refer to the reference material (links to Doxygen output).
Porting
Porting Related Header Files
FreeRTOS platform specific POSIX configuration
|
High Level Description
|
/lib/FreeRTOS-Plus-POSIX/include/FreeRTOS_POSIX.h |
This header file brings in dependencies required by FreeRTOS-Plus-POSIX. This file must be included before all other FreeRTOS-Plus-POSIX includes. |
/lib/FreeRTOS-Plus-POSIX/include/FreeRTOS_POSIX_internal.h |
FreeRTOS-Plus-POSIX internal structs and initializers. Users are not suggested to touch this file. |
/lib/FreeRTOS-Plus-POSIX/include/FreeRTOS_POSIX_portable_default.h |
Defaults for FreeRTOS-Plus-POSIX port-specific configuration options. |
/lib/FreeRTOS-Plus-POSIX/include/portable/[vendor-directory]/FreeRTOS_POSIX_portable.h |
Port-specific configuration overwrite of FreeRTOS-Plus-POSIX. As an example, /lib/FreeRTOS-Plus-POSIX/include/portable/pc/windows/FreeRTOS_POSIX_portable.h , Windows simulator uses the defaults, thus does not need to overwrite anything. |
FreeRTOS-Plus-POSIX Include Paths
/lib/FreeRTOS-Plus-POSIX/include |
/lib/FreeRTOS-Plus-POSIX/source |
/lib/include/FreeRTOS_POSIX/ |
Note that a project only needs platform specific header from this path /lib/FreeRTOS-Plus-POSIX/include/portable
.
Code Size
Code Size (Compiled with ARM Code Generation Tools (CGT), --silicon_version 7M4) |
File
|
Optimisation off, in Byte
|
Optimisation on, in Byte
(--opt_level 0 --opt_for_speed 0)
|
FreeRTOS_POSIX_clock.c
|
412
|
296
|
FreeRTOS_POSIX_mqueue.c
|
2016
|
1612
|
FreeRTOS_POSIX_pthread_barrier.c
|
294
|
200
|
FreeRTOS_POSIX_pthread.c
|
980
|
660
|
FreeRTOS_POSIX_pthread_cond.c
|
696
|
496
|
FreeRTOS_POSIX_pthread_mutex.c
|
848
|
608
|
FreeRTOS_POSIX_sched.c
|
48
|
32
|
FreeRTOS_POSIX_semaphore.c
|
540
|
380
|
FreeRTOS_POSIX_timer.c
|
972
|
788
|
FreeRTOS_POSIX_unistd.c
|
92
|
68
|
FreeRTOS_POSIX_utils.c
|
1152
|
768
|
Total
|
8050
|
5908
|
|
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.