Real-time kernel (RTK) is useful to run several task or protocol on one CPU. Since only one task at a time can be executed by MCU, RTK used to make each task think it owns the whole machine. RTK will handle which task has to be saved while other tasks execute.
TinyRealTimeis a very small and fairly fast real-time kernel for the atmega644 written by Dan Henriksson and Anton Cervin.This kernel has several characteristics which make it interesting:
- Several tasks can be created, limited by memory space. Practically, probably a maximum of a dozen or so tasks can be run on a Mega644/1284.
- Each task has a release time and deadline which determines when it executes. The scheduling algorithm is Earliest Deadline First (EDF).
- A task can be put to sleep for a period, thereby freeing the MCU for another task.
For more detail: TinyRealTime, Small Real Time Kernel for AVR using atmega644 microcontroller