StateOS
---------
StateOS is free, extremely simple and very fast real-time operating system (RTOS) designed for deeply embedded applications.
---------
Targets:
ARM Cortex-M, STM8.
---------
Inspiration:
StateOS was inspired by the concept of a state machine. Procedure executed by the task (task state) doesn't have to be noreturn-type. It will be executed into an infinite loop. There's a dedicated function for immediate change the task state (task function).
---------
Documentation:
All documentation is contained within source files, in particular header files.
---------
Gettin started:
Building an application for a specific compiler is realised using the appropriate makefile script.
---------
License:
This project is licensed under the terms of the MIT License (https://opensource.org/licenses/MIT).
---------
Features:
- kernel can operate in preemptive or cooperative mode
- kernel can operate with 16, 32 or 64-bit timer counter
- kernel can operate in tick-less mode
- implemented basic protection using MPU (use nullptr, stack overflow)
- spin locks
- once flags
- events
- signals with protection mask
- flags (any, all, protect, ignore)
- barriers
- semaphores (binary, limited, counting)
- mutexes with configurable type, protocol and robustness
- fast mutexes (error checking)
- condition variables
- read/write locks
- memory pools
- stream buffers
- message buffers
- mailbox queues
- event queues
- job queues
- timers (one-shot, periodic)
- cmsis-rtos api
- cmsis-rtos2 api
- nasa-osal support
- c++ wrapper
- all documentation is contained within source files, in particular header files
- examples and templates are in separate repositories (https://github.com/stateos)
---------
6.7
- updated os version
- implementation of steady clock
- updated Timer class
- updated Task class
- updated other classes
- removed unused OS_FUNCTIONAL definition
- added CNT_LIMIT definition
- updated stack assertions
- check task stack watermark
- added tsk_stackSpace function
- removed JOINABLE and DETACHED definitions
- fixed bug in tsk_destroy function
- used std::unique_ptr with dynamic objects
- added MPU for prevention the use of the NULL / nullptr
- added MPU for prevention the stack overflow
- removed empty __CONSTRUCTOR definitions
- renamed sys_alloc function to malloc
- added set of standard aligned memory allocation functions
- the task deleter go back to the idle process
- simplified parameters of the core_tsk_wait function
- updated signal functions
- updated message buffer functions
- updated stream buffer functions
- changed type of system functions result (int)
- added read/write lock
- added lock guard
---------
6.6
- updated os version
- updated license
- updated c++ constructors
- updated JobQueueT class
- added baseStack class
- added baseTimer class
- updated usage of std::function
- fixed errors reported by the armcc v5 compiler
- simplified c++ constructors
- added wrk_init function
- now sys_alloc don't clear allocated memory
- updated c++ create functions
- updated c++ wrapper
- added sys_heapSize function
- task destructor is called in alloc / free functions
- rebuilded c++ static functions
- added several static functions to the Timer class
- added several static functions to the Task class
- added constructor with function arguments to the Timer class
- added constructor with function arguments to the Task class
- updated semaphore (removed send functions)
---------
6.5
- added functional test
- added support for stm32l1
- updated stm8s port file
- updated port definitions
- added tsk_exit alias
- fixed 'zero-as-null-pointer-constant' warnings
- updated iarcc osdefs header file for cortexm
---------
6.4
- removed ID_BLOCKED constant
- removed ID_IDLE constant
- added signal handler
- changed c++ functional procedures
- updated assertions
- modified context structures
- added dynamic tasks
- added create/destroy functions to c++ wrapper
- updated c++ wrapper
---------
6.3
- merged test branch
- renamed 'SIZE' definitions
- back to the event (evt) and event queue (evq)
- added a few function aliases
- added once flag object
- added mutex mode (type, protocol, robustness)
- updated flag object
- updated queue/buffer objects
- updated queue/buffer functions
- added E_FAILURE event
- added examples
- changed assert definitions
- definitions regarding the task have been moved to the task header file
- updated condition variable object
- fixed bug in tmr_wait functions
- updated tsk_sleep functions
- added system delayed queues
- updated barrier object
- updated signal object
- renamed ID_DELAYED to ID_BLOCKED
- changed resource management
- changed task start procedures
- added function aliases for the current task
- added resource assertions
- current task is destroyed asynchronously by the destructor
- renamed idle procedures
- changed usage of signals
- added E_DELETED event constant
- updated event object and examples
---------
6.2
- updated kernel
- added initial value for flag object
- updated tsk/tmr init functions
- added static c++ classes
- added optional stack size parameter for task create definitions
- added optional type size parameter for message buffer create definitions
- added optional limit parameter for semaphore create definitions
- added optional type size parameter for stream buffer create definitions
- updated stream buffer object
- updated message buffer object
- added optional init parameter for flag create definitions
- added optional signal type parameter for signal create definitions
- static private functions work inside critical sections
- removed event object; event queue object renamed to 'evt'
- fixed stack initialization
- changed mem_init function
- changed evt_init function
- changed job_init function
- changed box_init function
- changed msg_init function
- changed stm_init function
- reorganized kernel functions
- added object header
- added header init functions
- rebuilded sleep and suspend / resume functions
---------
6.1
- updated os version
- updated mailbox queue object
- updated message buffer object
- updated stream buffer object
- added spin lock object
- some lock definitions moved to kernel
- updated XXX_CREATE definitions
- updated lock definitions and usage
- updated version identification
- added tmr_startNext, tmr_waitNext and tsk_sleepNext functions
- reorganized the order of functions
- the task/timer identifier is an enumeration constant
---------
6.0
- updated os version
- updated message buffer object: size of the message data limited to size of the buffer
- updated stream buffer object: size of the stream data limited to size of the buffer
- reorganized task structure
- changed kernel filenames
---------
5.9
- updated os version
- updated task object
- updated mailbox queue object
- updated kernel
- updated stream buffer object
- renamed message queue to event queue
- added message buffer object
- added examples for new feature
- updated event queue object
---------
5.8
- added stream buffer object
- updated examples
- fixed bugs in isr functions
- removed direct semaphore (use signal instead)
- updated const qualifiers
- changed syntax of box_init function
- updated kernel
---------
5.7
- updated memory pool object
- updated list object
- updated examples
- updated kernel
- added box_push, msg_push and job_push functions
---------
5.6
- changed license to MIT
---------
5.5
- some preprocessor definitions have been changed
- updated kernel files
- removed Counter definition
- added sys_time functions
- removed Current definition
- added tmr_this and tsk_this functions
- function tmr_this renamed to tmr_thisISR
- fixed bugs in nasa-osal api
- fixed bugs in cmsis-rtos2 api
- updated semaphore object (added semDirect feature)
- the OS_ASSERT definition has been removed, use DEBUG/NDEBUG instead
- updated tick-less mode
- updated waitUntil functions
- removed OS_TICKLESS definition, tick-less mode depends on OS_FREQUENCY value
- os can work with 16, 32 or 64-bit timer counter
---------
5.4
- added startup files for cosmic compiler
- added support for IAR compiler
- updated support for CMSIS-RTOS2 API
- added some definitions for CSMCC
- moved alloc/free functions to osalloc.c file
- updated alloc/free functions
---------
5.3
- updated inclusion of header files
- fixed bug for CM0 and gcc compiler
- updated job queue object
- updated core_sys_alloc functions
- updated memory pool object
- updated internal MSIZE definition
- updated tsk_detach / tsk_join functions
- added xxx_delete functions
---------
5.2
- added BinarySemaphore c++ class
- renamed functions: tsk_create to wrk_create and tsk_new to tsk_create
- added aliases for xxx_create functions (xxx_new) and XXX_CREATE macro definitions (XXX_NEW)
- updated c++ code
- added OS_TMR_START, OS_WRK_START and OS_TSK_START macros
only available for compilers supporting the "constructor" function attribute or its equivalent
- added examples for new feature
- added OS_TMR_UNTIL macro (with tmr_startUntil function) similar to OS_TMR_START macro (with tmr_start function)
- in non-tick-less mode each task has its own time slice
- internal system timer handler moved to kernel
- added internal function core_cur_prio
- added job queue object
- added examples for new feature
- changed internal implementation of some objects
- updated inclusion of header files
---------
5.1
- updated access to the c++ functional library
- updated port files
- added osdefs.h header file
- used Current instead of System.cur
- used config OS_TICKLESS instead of OS_TIMER
- added stack assertion
---------
5.0
- updated cmsis-rtos2 api to version 2.1.1
- updated osport header file
- system counter is always 32-bit size
- added port_cnt_lock / port_cnt_unlock macros
- added sys_time function for read current value of system counter
- updated cmsis-rtos2 osKernelGetSysTimerCount function
- reorganized port directories
- optionally included c++ functional library (not available for all compilers)
- added examples for new feature
---------
4.9
- changed tsk_suspend / tsk_resume functions
- added tsk_suspend example
- rebuilt port / core files
- fixed bug in mutex object
---------
4.8
- updated OS_TMR / static_TMR macros
- added OS_TMR_DEF / static_TMR_DEF macros
- updated OS_WRK / static_WRK macros
- renamed OS_DEF / static_DEF macros to OS_WRK_DEF / static_WRK_DEF
- renamed OS_NEW / static_NEW macros to OS_TSK_DEF / static_TSK_DEF
- updated examples
---------
4.7
- updated macros for task and timer objects
- updated examples
- added tsk_getPrio / tsk_setPrio inline functions
- reorganized kernel directories
- updated objects definitions
---------
4.6
- added JOINABLE and DETACHED constants
- function mem_reset renamed to mem_bind
- redefined timer macros and procedures
- added OS_IDLE_STACK definition
- function core_tsk_start renamed to core_tsk_loop
---------
4.5
- rename flgOne to flgAny
- added flg_clear function
- added protection to flag object
- added cmsis-os2 API
- added cmsis-os2 example
- added tsk_detach function
- rebuilt cmsis-os1 api
- rebuilt nasa-osal api
- only delayed and suspended tasks can be resumed
- tsk_wait functions return received flags or messages
- mem_init function renamed to mem_reset
- added xxx_init functions and corresponding example
---------
4.4
- added oslibc.c file for COSMIC Software CORTEX-M C Cross Compiler
- added _TSK_CREATE macro in os_tsk.h file
- changed OS_DEF macro and added OS_NEW macro in os_tsk.h file
- added sys_alloc and sys_free procedures
- updated cmsis-rtos and nasa-osal
- added changes in some definitions
- rebuilt kernel
---------
4.3
- rebuilt internal preprocessor definitions
- rebuilt data structures
- rebuilt c++ classes
- updated examples
---------
4.2
- added tsk_join function
- added assertions
---------
4.1
- more kernel improvements
- new concept of task-switching for cortex-m: second try
---------
4.0
- tsk_flip is realized through core_tsk_flip function
- improved performance of kernel
---------
3.9
- added support for STM8S-Discovery board
- initiating a process stack has been removed from the context switch procedure
---------
3.8
- updated task object
- back to kernel v3.5
---------
3.7
- better integration with CMSISv5
- fixed bug in tsk_flip procedure
- added partial support for NASA Operating System Abstraction Layer
- added example for NASA OSAL
- updated timer object
---------
3.6
- new concept of task-switching: now the main task can also be restored from the main stack
- updated core and port files
---------
3.5
- updated list object
- updated memory pool object
- optimized c++ code
---------
3.4
- added list object
- added mail queue functions to cmsis_os api
- fixed bug in memory pool object
---------
3.3
- added direct signal and message transfer to task object
- added signal functions to cmsis_os api
---------
3.2
- updated memory pool object
- added memory pool examples
---------
3.1
- added CMSIS-RTOS API
- added CMSIS-RTOS example
- added memory pool object
---------
3.0
- added support for COSMIC Software CORTEX-M C Cross Compiler
---------
2.9
- program code cleaned
---------
2.8
- changed startup files
- fixed bug in core_ctx_switch for armclang and Cortex-M0
---------
2.7
- fixed some bugs in arm clang code
- fixed stack alignment
- fixed some bugs
---------
2.6
- added support for arm clang
---------
2.5
- idle_hook procedure moved to oskernel
- simplified kernel code
---------
2.4
- kernel optimalization
---------
2.3
- example files moved to dedicated folder
- changed makefiles
- optimized kernel
---------
2.2
- minor update
- added c and c++ examples
- tsk_stop function doesn't destroy the stack storage
---------
2.1
- reorganization of the c++ code
- fixed bug in MessageQueueT<> class
- fixed bug in MailBoxQueueT<> class
- added c++ examples
---------
2.0
- added some features to c++ code
- added c++ examples
- added c++ class destructors guarding
---------
1.9
- added fast mutex object
- fast mutex is non-recursive and non-priority-inheritance
- added example for new feature
- fixed bug in semaphore initialization
- removed mutex type from mutex initializer
- mutex is recursive and priority inheritance
---------
1.8
- fixed bug in task initialization
- SysTick is used for triggering context switch in tick-less mode
---------
1.7
- the priority of main process is configurable
- fixed bug in startup file for armcc compiler
- fixed bug in core_sys_alloc function
---------
1.6
- fixed bug in tick-less mode
- optimized kernel
---------
1.5
- added sig_take function
- changed flag mode constants
- added some optimizations
- changed startup files
---------
1.4
- added signal object
- added example (main.c.19) for new feature
- changed flag object
---------
1.3
- rewritten memory allocation functions
- added tsk_startFrom function
- added example (main.c.18) for new feature
---------
1.2
- added new features for use in 'C' code only
- added examples (main.c.14-17) for some of new features
---------
1.1
- all comments have been translated into English and rewritten in interface files as documentation
- definitions and functions for creating semaphore now include the initial value of the semaphore counter
---------
1.0
- first stable version
- to do: translate comments into English
---------
0.9.5
- fixed semaphore functions
- removed semDirect constant
- fixed message queue
- fixed mailbox queue
- added message queue example (main.c.12)
- added mailbox queue example (main.c.13)
- fixed mutex
- removed tsk_force function
- lock/unlock functions moved from osport to oskernel
---------
0.9.4
- in cooperative mode context switch is realized by PendSV
- current task is a guard object in tsk_sleep function
- fixed bug with gcc -O3 optimization
- port_tsk_break renamed to core_tsk_break and rewritten in C
---------
0.9.3
- added barrier (bar) object
- added barrier example (main.c.10)
- added oslibc.c file
---------
0.9.2
- changed 'flg' procedures
- added 'flg' mode constants: flgAccept, flgClear
- added blocked mask for 'flg'
---------
0.9.1
- fix bug in non static objects definitions
- add guard object in tsk_sleep function
---------
0.9
- reorganization of the semaphore code
- added semDirect constant
- reorganization of the mutex code
---------
0.8.5d
- reorganize the file structure
- rename PRIVATE_XXX to static_XXX
---------
0.8.5c
- update makefiles
- update bitband.h
---------
0.8.5b
- more improvements in tick-less mode
- more improvements in support of virtual timers
---------
0.8.5a
- improved tick-less mode
- improved virtual timers support
- support for armv6-m and armv7-m devices at system level
---------
0.8.5
- added support for CM0, CM0+ and CM3 at system level
---------
0.8.4
- updated task startup procedures
---------
0.8.3a
- fixed bug in GRN_Led class
---------
0.8.3
- added configuration files for STM32F4_Discovery
- added configuration in example files
---------
0.8.2a
- tasks switch optimization
---------
0.8.2
- modified procedure for the preparation of the stack for new and restarted tasks
---------
0.8.1
- fixed bug in kernel function: core_tsk_prio
---------
0.8
- updated examples and several other changes
- changed 'flg' procedures
- added 'flg' mode constants: flgOne, flgAll
---------
0.7.3a
- small update for mutexes and semaphores
---------
0.7.3
- added some features to semaphores and mutexes