RTOS ( Real-Time Operating system) is a programming environment that interfaces hardware and desired tasks. RTOS usually has a built-in set of services (interfaces and functions) that allow interaction between tasks and hardware. Because most low-level functions are performed by RTOS, the realization of programs becomes much easier.
What is the difference between Embedded RTOS System and a regular OS (Operating System)? The main difference is that RTOS performs tasks according to reaction time on one or another event. Many microcontrollers have the ability to support one or another Real-Time Operating System.
According to this, we can say that RTOS is a background application that controls multiple tasks and alleviates managing those tasks. Note that the Operational system can perform multiple tasks at one time. This is called multitasking. We all know that microcontroller can perform only one task simultaneously, but if we cut time into too small pieces and perform all tasks in a row for a bit of time, then we achieve multitasking—this like illusion of performing tasks at one time.
If you are familiar with the system programming of PC, you should know what processes and flow are and the planning of tasks (including real-time ones)…
So if you are going to use RTOS in your project, you should know the minimal requirements for your system – program memory, data memory, and processor time, of course. Program memory in microcontrollers is minimal. Embedded RTOS System takes quite much space because it has many functions to support all hardware and particular routines.
All tasks in RTOS has their own priority. The biggest priority is given to the most important tasks. Tasks are planned by the so-called planner, which places all tasks in a row by giving them some processor time and priority. As I mentioned, only one task can be performed at a given moment. After the processor time of one task ends, it is stopped, saved its stage, and time is given to another task. One task’s time has to be not too long that other tasks could be performed normally. On the other hand, those tasks shouldn’t be too short because then all-time will switch between tasks.
Priority is another important parameter of tasks. Priority describes how fast a particular task should react to the event or interrupt. For instance, if your project is some robot, then tasks related to reacting to sensors will have bigger priority than, for example, output information to display task.
If the system becomes very big and the number of tasks increases too big numbers, sometimes even tasks with the biggest priority can be delayed. Then real-time term becomes conditional…