Notes
RTOS
Content of the notes (2)
Page 1
RTOS: Real-Time Operating System
What is RTOS?
RTOS is a real time operating system specially designed to handle multitasking where tasks are time sensitive.
Unlike OS (General purpose Operating System) which lets the user execute multiple programs (thread) at the same time using multi-threading concepts, RTOS manages tasks that need to be executed at a specific time.
It can be said that tasks are the building blocks of RTOS.
These tasks act independently as if they were their own program.
Why RTOS?
RTOS is implemented in situations where timing is very important. For example, the Airbag Safety System, in case there is a crashing incident it must calculate the impact of crash and decide whether to deploy the airbag or not within milli seconds. This is a situation where timing is a crucial factor so RTOS implementation will be the best option to handle it.
RTOS vs GPOS
RTOS gives priority to time critical tasks which need to be executed within the deadline whereas GPOS uses preemptive multitasking to allocate processor time to various threads.
RTOS guarantees predictable response time whereas GPOS may experience occasional delays since it focuses on resource allocation for multiple programs.
Types of RTOS
Hard RTOS
No deadlines can be missed
Soft RTOS
Occasional delay may happen, but it doesn’t lead to complete failure
Page 2
Functions
Task Creation
xTaskCreate() - xTaskCreate(TaskFunction, // Pointer to task function
TaskName, // Name of task
Stacksize, // stack size for task in words
Parameters, // can be NULL
Priority,
Handle // can be NULL
Task Delay
vTaskDelay() - vTaskDelay(DelayTime);
vTaskDelay(1000 / portTICK_PERIOD_MS): portTICK_PERIOD_MS converts milliseconds into ticks for RTOS
Task Deletion
vTaskDelete() - vTaskDelay(TaskHandle)
Example
There are 3 tasks,
Object detection (Low Priority task)
Light intensity detection (High Priority task)
Solar panel angle detection (Medium Priority task)
Information
- Description
- Note on RTOS, created by Jaya P on 16/09/2024.
- Created by
- Jaya P
- Views
- 0
- Rating