I need some help. I have a project to build an alternative scheduler for freeRTos, with a different algorithm, and try to replace it in the OS.
My questions are:
Is it possible in normal time? (for about few months)
How do I rec开发者_运维技巧ognize the code of the scheduler in the whole OS code?
Given that FreeRTOS is only a few thousands lines of code it is certainly possible within a few months. If you know how to write a scheduler, of course.
However, FreeRTOS doesn't even have a real scheduler. It maintains a list of runnable tasks, and at every scheduling point (return from interrupt or explicit yield), it takes the highest priority task from that list.
To add more answers to question 2:
Task controls are in tasks.c, portable/port.c contains context switches.
Have a look at the source organization doc; a given function name gives away which file it's defined it. There really isn't too many places where they can be either. Use grep :)
精彩评论