10 years, 2 months ago.

How can I implement a new scheduler on CMSIS-RTOS on mbed?

I want to implement a new scheduler, like Earliest Deadline First scheduler, on the RTOS on mbed.

I imported the rtos from https://mbed.org/users/mbed_official/code/mbed-rtos/;

I found there exist a file under rtx/TARGET_M4/rt_Robin.c; Is this the existing round robin scheduler on this RTOS? (Well, this is just an API library for the CMSIS-RTOS, I hope I can just change the files in this mbed-rtos to get a new scheduler, which is faster and more convenient.)

What if I want to print out something in serial port in the code under rtx folder? In other words, how can I print out something to the serial port in the mbed-rtos code?

Thank you very much for your time and help!

Question relating to:

1 Answer

10 years, 2 months ago.

Hi,

yes, rt_Robin,c should be an implementation for the scheduler.

Why do you need to print something in the kernel? You can add a dependency on mbed-lib into kernel, if really required.

Regards,
0xc0170

Thank you very much for your quick reply! :-) The reason why I need to print something in the kernel is that I want to know what is going on in the scheduler. For example, if I want to replace the rt_Robin.c with some other scheduler file, I need to debug the new scheduler I add. So I want to know if the scheduling sequence is correct by printing out the schedule decision.

As to your suggestion "add a dependency on mbed lib into kernel", could you please give me a pointer to a tutorial of how to do that? I'm sorry that I only had some linux kernel on intel machine experience but didn't have much experience on mbed before. :-(

posted by Meng Xu 01 Sep 2014