kahlonel / Rt0s
Minimal Realtime OS for Cortex-M0
Stars: ✭ 41
Programming Languages
assembly
5116 projects
Projects that are alternatives of or similar to Rt0s
drone-stm32-map
STM32 peripheral mappings for Drone, an Embedded Operating System.
Stars: ✭ 16 (-60.98%)
Mutual labels: arm, rtos
Prettyos
A Preemptive Hard Real Time kernel for embedded devices.
Stars: ✭ 36 (-12.2%)
Mutual labels: arm, rtos
DemOS
Free, simple, extremely lightweight, stackless, cooperative, co-routine system (OS) for microcontrollers
Stars: ✭ 18 (-56.1%)
Mutual labels: arm, rtos
Distortos
object-oriented C++ RTOS for microcontrollers
Stars: ✭ 354 (+763.41%)
Mutual labels: arm, rtos
Polymcu
An open framework for micro-controller software
Stars: ✭ 173 (+321.95%)
Mutual labels: arm, rtos
Pikort
A tiny Linux-like real-time kernel optimized for ARM Cortex-M chips
Stars: ✭ 268 (+553.66%)
Mutual labels: arm, rtos
drone-cortexm
ARM® Cortex®-M platform crate for Drone, an Embedded Operating System.
Stars: ✭ 31 (-24.39%)
Mutual labels: arm, rtos
Qpcpp
QP/C++ real-time embedded framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
Stars: ✭ 124 (+202.44%)
Mutual labels: arm, rtos
Rt Thread
RT-Thread is an open source IoT operating system.
Stars: ✭ 6,466 (+15670.73%)
Mutual labels: arm, rtos
Qpc
QP/C real-time embedded framework/RTOS for embedded systems based on active objects (actors) and hierarchical state machines
Stars: ✭ 379 (+824.39%)
Mutual labels: arm, rtos
Vuejs Slack Clone Realtime
Slack clone using VueJS and firebase
Stars: ✭ 33 (-19.51%)
Mutual labels: realtime
Reactivemaps
A data aware UI components library for building realtime maps
Stars: ✭ 944 (+2202.44%)
Mutual labels: realtime
rt0s is a preemptive, multithreaded, realtime OS built for ARM Cortex-M0
Usable Features
- Create threads at runtime using
rt0s_thread
- Threads can yield using
rt0s_yield
- Threads can quit using
rt0s_kill
- Increase semaphore count using
rt0s_sem_signal
- Threads can wait on a semaphore using
rt0s_sem_wait
See rt0s.h
file for the function signatures.
Design Notes
- Kernel fits under 1k bytes, 1k assembly lines
- 100 bytes allocated for kernel stack
- Kernel RAM usage =
20*(Max threads) + 4*(Max semaphores) + 3
bytes - Max number of threads and semaphores are known at compile-time
- Thread stack size is known at compile-time (same for all threads)
- Static memory usage / no dynamic memory allocation
- Round-robin pre-emptive scheduling
- All threads have same priority
- Thread switch latency =
192 + 50.4*(Number of threads created)
cycles- For demo board STM32F0308-DISCO with 8MHz crystal, and for
N=10
, the thread latency is 696 cycles / 87 microseconds
- For demo board STM32F0308-DISCO with 8MHz crystal, and for
- Interrupts are disabled during thread switching
Attempt at a scheduling overview diagram
+----------+ +----------+
+-----+ Thread N +-----------+ |Thread N+1|
| +-------+--+ | +-----+----+
| | | ^
| | | |
v v v |
+-------+------+ +--+--+ +-----+-----+ +-----+----+
|Wait Semaphore| |Yield| |SysTick IRQ| |PendSV IRQ|
+-------+------+ +---+-+ +-------+---+ +-----+----+
| | | ^
| +-------+ | | |
+--->+SVC IRQ+<+ | |
+---+---+ v |
| +-----+-------+ |
+-------------->+Schedule Next+-------------+
+-------------+
Demo code
Code for STM32F0308-DISCO board has been added to boards/ folder. The demo code uses semaphores and yield function to debounce a button.
You can add your board into the boards/ folder. Create a folder with your board's name and add these files into it:
- linker.ld: with correct addresses/sizes for flash and RAM.
- cfg.s: SysTick clock frequency.
- main.c: actual application code.
Then change the BOARD
value in Makefile to your board's name, and run make
.
Flash rt0s.elf or rt0s.hex.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].