An RTOS is a lightweight operating system designed for embedded devices that guarantees execution of tasks within strict, deterministic time constraints.
- Deterministic Scheduling: Preemptive priority scheduling, time slicing, and rate-monotonic analysis (RMA).
- Task Management: Creating tasks, priorities, stack allocations, and task states (Running, Ready, Blocked, Suspended).
- Inter-Task Communication:
- Queues: Passing data blocks between tasks.
- Semaphores & Mutexes: Access control for shared hardware resources.
- Common Issues:
- Priority Inversion: A low-priority task holds a mutex needed by a high-priority task, while a medium-priority task runs. Resolved via Priority Inheritance.
- Popular RTOS: FreeRTOS, Zephyr RTOS, VxWorks, RT-Thread.