Freertos posix Development
Revision as of 00:33, 17 September 2009 by Tcwden
- 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
- The most up-to-date development can be found at repository freertos_posix
- 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
- You can also generate HTML documentations in the source code using doxygen
- Goto /posix and use the Doxyfile to generate documentation under /posix/doc
- Refer to software architecture from here
POSIX Threads Scheduler
- 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
- 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
- to be added