Here you will find a co-operative operating system (more precisely: co-operative scheduler) that I implemented as part of the course "Embedded Operating Systems" at the university. I called it cobuc. cobuc is a partial blend (Coburg [name of a small city located in Bavaria in Southern Germany] + Cooperative Multitasking ) Feel free to extend/adjust this project so that it meets your goals.
A simple API was developed for process management, which offers the following methods:
- create (to create new processes)
- destroy (for deleting processes)
- yield (to switch processes and contexts)
Process and context switch can be carried out using pure assembler code as well as a combination of C and assembler (controllable by a macro). Project is heavily commented
and documented. You will find the documentation under documentation/html
(this directory contains an automatically documentation generated by Doxygen).
The operating system was implemented and tested for an Arm-based processor (Arm Cortex M4). A chaser light application (with 8 LEDs) was used for illustration and demonstration.
Two processes each control 4 LEDs (one for the right and one for the left strip). There is also an initial process that takes care of all the configurations and initialisations.
In addition, a fourth process takes care of the delay between the individual steps. By defining new processes, the two strips can be operated at different frequencies.