- RTOS means Beal-Time Operating System.
- Special OS used in embedded systems for deterministic (time-critical) operations.
- Required in systems where multiple things/executions happen together like sensor data reading, motor controlling, communication with other peripherals.
Abbreviations
- PCB – Process Control Block.
- TCB – Task Control Block.
- RTOS – Real Time Operating System
- GPOS – General Purpose Operating System
- OS _ Operating System
RTOS Vs GPOS
- GPOS for Gentral Purpose Usage like Windows, Linux, Android, Apple IOS.
- RTOS are Like FreeRTOS, VxWorks, QNX, INTEGRITY
Different RTOS:
- FreeRTOS from FreeRTOS.rg
- VxWorks from
- embOS from SEGGER
- uC-OS
Scheduler
- Decides which task/Threads should run at time with respective to which priority.
What is Task/Threads?
- Its small independent units of execution.
Task States
- Ready
- Running
- Blocked
- Suspended
What is Preemptive Scheduling?
- Higher priority task can interrupt a lower priority task.
Cooperative Scheduling?
- Task must voluntarily yield CPU. Simpler, but if one task never yields, system can hang.
Context Switching?
- A context switch is a procedure that a computer’s CPU (central processing unit) follows to change from one task (or process) to another while ensuring that the tasks do not conflict. Effective context switching is critical if a computer is to provide user-friendly multitasking.
- Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process.
What are the different interprocess communications?
- Queue – FIFO structure for sending data between tasks.
- Mail Box – Like queue, but stores only one message at a time.
- Semaphore
- Counting Semaphore: Control access to limited resources (e.g., 3 UART channels).
- Binary Semaphore: Acts like a signal (e.g., ISR signals a task).
- Mutex – Protects shared resource (e.g., one task at a time writes to EEPROM). Has priority inheritance to avoid priority inversion.
- Message passing (MAIL BOX),
- Shared a memory,
- Socket connections.
Dead Lock
- Two or more tasks wait forever for each other’s resources.
Priority Inversion
- High-priority task blocked by low-priority task holding resource
Priority Inheritance
- Temporarily boost low-priority task.
More
Hits (since 2024-Jan-26) - 597