How does RTOS fulfill its functions?

Status
Not open for further replies.

eexuke

Full Member level 4
Joined
Mar 25, 2004
Messages
196
Helped
10
Reputation
20
Reaction score
3
Trophy points
1,298
Activity points
1,934
Dear all,
In my understanding, the purpose of RTOS is:
1. to schedule tasks so that all tasks can be executed at the appropriate moment and finished before the respective deadlines.
2. to eliminate shared data problem by providing semaphore mechanism
3. to provide communication channels between tasks in the forms of queues, mailbox, pipes...

My question remains how a RTOS achieves all these when running on a specific processor such as a general purpose VLIW. Can anybody shed some lights on it?
 

[help] about RTOS

One simplistic answer would be that everything is based on a clock 'tick' so instead of finishing a linear piece of code, an interrupt is generated on each 'tick'. The interrupt processing decide then that such thread must be interrupted (too long) or may continue.. And so on and so forth.
In reality it is more complicated than this, but for a simple explanation..
 

[help] about RTOS

In my opinion, RTOS not only for SW viewpoint but also the HW. How to optimize the usage of resource is the key point. Hard imagine run a strong RTOS only in MCU51.
 

Re: [help] about RTOS

RTOS is just some house keeping programe that take all the pardons like schduling , data handling , etc and leave the developer to worry only about the given problems.
The kernel part which is in direct contact with the hardware must be hardware dependent and the other parts need not be depends on plateform on which it is running.
 

[help] about RTOS

RTOS also have the memory management function, you don't have to worry about the memory allocation for variables, just use system call to apply a space, conflict will not happen.
 

Re: [help] about RTOS

I think memory management is not a strong point for rtos. Most rtos employs a simple memory management scheme. They prefer to a flat memory model for memory efficiency. In this model all tasks share the same memory space. It is like thread in traditional OS. When you use malloc to request memory from heap, it is a global memory pool.
 

Re: [help] about RTOS

main concepts for RTOS are

Memory management
Task scheduling
scheduling policy
intertask communication
 

Re: [help] about RTOS


Yes these are tasks of an RTOS. In fact all Os provide these facilities. The only difference is that RTOS provides specific time guarantees. For example, in an RTOS we can provide guarantee of time duration in which an interrupt handling shall begin. This is not the case with general purpose OSs.

How is this achieved - well these are all dependent on algos. Note that it is not the RTOS responsibility to ensure that a task finishes before certain deadline. In fact, the RTOS can't possibly know this deadline! It is the responsibility of the prograamer who codes that task to ensure this. Then what does RTOS guarantee? Wel, it only guarantees the task switover times. And to ensure that your task gets all the time it needs, RTOS implements pre-emptive scheduling. That means if yopu have a task that has the highest priority, it shall continue to execute untill it either finishes or gets blocked. If your task continues without providing any CPU to other less priority tasks, that's your problem.

As far as intertask communication mechanisms and semaphores are concerned, they are not the feature of RTOS only. In fact they atre present on any general purpose OS that is worth its salt.
 

Re: [help] about RTOS

Every good RTOS is made up of a good Real Time kernel
Kernel sits just above the Hardware and It's the kernel which interacts with the H/W various method's and technique are used so that the kernel can give a Real Time services.

From here there are two section H/W & S/W both depend on each other if you have a very good H/W but not so good S/W then the resuld are poor
and vice versa

so H/W designer keep on imporving the H/W and S/W guys keep on doing the same
 

[help] about RTOS

In general, what RTOS defferent with OS is that a definite interrupt reponse time and fast tasks switch.
 

[help] about RTOS

RTOS is the way to achieve highest performance in terms of interrupt response and task switch speed on a given hardware platform
 

Re: [help] about RTOS

for RTOS pls ski to freertos.org


it has a good document and the source code for many processor ports are free


enjoi
 

Re: [help] about RTOS

Somewhere I read, but nice quote about RTOS.

RTOS is similar to normal OS, but apart from normal parameters with which your normal OS considers a failure, RTOS considers all of them along with time too. i.e., if it didn't happen within given time, it is failed to happen!
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…