Difference between revisions of "Freertos posix Development"

From OpenCircuits
Jump to navigation Jump to search
(add introduction)
Line 1: Line 1:
 
This wiki describes the development of freertos_posix - a POSIX wrapper for [http://www.freertos.org/ FreeRTOS]. The wrapper has been used for deploying the [[DsPIC30F 5011 Development Board | dsPic33 development board]].
 
This wiki describes the development of freertos_posix - a POSIX wrapper for [http://www.freertos.org/ FreeRTOS]. The wrapper has been used for deploying the [[DsPIC30F 5011 Development Board | dsPic33 development board]].
  
==Architecture==
+
==Introduction==
*Refer to software architecture from [[Multi-purpose_Embedded_System#RTOS | here]]
+
*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==
+
===Source Code Repository===
 
*The most up-to-date development can be found at repository [http://chungyan5.no-ip.org/vc/?root=freertos_posix freertos_posix]
 
*The most up-to-date development can be found at repository [http://chungyan5.no-ip.org/vc/?root=freertos_posix freertos_posix]
 +
 +
 +
===Features===
 +
*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.
 +
*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===
 +
*You can also generate HTML documentations in the source code using [http://www.stack.nl/~dimitri/doxygen/ doxygen]
 +
**Goto '''/posix''' and use the Doxyfile to generate documentation under '''/posix/doc'''
 +
 +
 +
==Architecture==
 +
*Refer to software architecture from [[Multi-purpose_Embedded_System#RTOS | here]]
  
  

Revision as of 21:03, 8 September 2009

This wiki describes the development of freertos_posix - a POSIX wrapper for FreeRTOS. The wrapper has been used for deploying the dsPic33 development board.

Introduction

  • 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


Features

  • 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.
  1. POSIX Thread: mapped to FreeRTOS task (pthread.h, and unistd.h)
  2. Mutex functions: mapped to FreeRTOS semaphore
  3. Filestream operations (e.g. open, read, write, lseek, etc): not associated with any FreeRTOS functions (unistd.h)
  4. Time and clock functions (e.g. time and clock): using the context switch timer required in FreeRTOS (time.h)
  5. Socket API: mapped to uip: Please note that the socket API is only posix-like and it is NOT compatible with standard POSIX operation.
  • Extra functions include:
  1. a coroutine task scheduler, in order to run multiple POSIX threads in a single FreeRTOS Task (see pthread.c and system.c)
  2. dsp library API


Documentations

  • 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

  • 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


Power Management

  • to be added