Freertos posix Development
Jump to navigation
Jump to search
This wiki describes the development of freertos_posix - a POSIX wrapper for FreeRTOS. The wrapper has been used for deploying the dsPic33 development board.
Contents
Introduction[edit]
- freertos_posix is a POSIX wrapper for FreeRTOS.
- The platform independent files (apart from those those under /posix/asm-dsPic) are saved under /posix.
- Platform dependent files (such as drivers) are stored under demo_posix/xxx, where xxx is the name of your target platform.
Source Code Repository[edit]
- The most up-to-date development can be found at repository freertos_posix
Features[edit]
- Not all POSIX functions are implemented, the followings are the major functions developed. You are invited to contribute new functions and improve the existing ones.
- POSIX Thread: mapped to FreeRTOS task (pthread.h, and unistd.h)
- Mutex functions: mapped to FreeRTOS semaphore
- Filestream operations (e.g. open, read, write, lseek, etc): not associated with any FreeRTOS functions (unistd.h)
- Time and clock functions (e.g. time and clock): using the context switch timer required in FreeRTOS (time.h)
- Socket API: mapped to uip: Please note that the socket API is only posix-like and it is NOT compatible with standard POSIX operation.
- File system operations: mapped to FatFs. (under development)
- Extra functions include:
- a coroutine task scheduler, in order to run multiple POSIX threads in a single FreeRTOS Task (see pthread.c and system.c)
- dsp library API
Documentations[edit]
- You can also generate HTML documentations in the source code using doxygen
- Goto /posix and use the Doxyfile to generate documentation under /posix/doc
Architecture[edit]
- Refer to software architecture from here
POSIX Threads Scheduler[edit]
- The task scheduler is based on FreeRTOS incorporating coroutine developed by Simon Tatham. The scheduler API is wrapped by the POSIX Thread API.
- e.g. pthread_create(), usleep(), etc.
POSIX Driver Development[edit]
- Software drivers are developed to allow users at Application Level to use the hardware (e.g. ADC, DAC, UART, NVM etc) through the POSIX System call API.
- e.g. open(), write(), read(), ioctl(), lseek(), etc.
- An example of how to develop drivers for Microchip dsPic33 devices can be found here
Power Management[edit]
- to be added