- Fixed-priority pre-emptive scheduling
- Process aging to avoid starvation
- Pre-emptive spin-lock mechanism
- Relatively small and simple to learn from
Refer to the main.c file for examples on how to integrate and use the operating system in your AVR microcontroller projects.
-
Description: Revamped the existing context switch strategy to address fairness issues observed in the previous implementation. The old strategy did not ensure equitable switching between tasks based on their priorities, leading to suboptimal performance. The new context switch algorithm prioritizes fairness by considering task priorities, resulting in improved overall system behavior.
Two video files have been added to the documents directory for visual comparison between the old and new algorithms.
- Description:
Addressed a critical problem in the
osAsmYieldFromTickfunction andSAVE_CONTEXTmacro within theasm.cfile. The issue stemmed from the improper handling of global interrupt – specifically, disabling it without re-enabling, leading to the unintended disablement of timer1 interrupt. Consequently, this was disrupting context switching functionality. The fix ensures proper global interrupt management, preventing interference with timer1 and restoring seamless context switching.
- ATMega32
- GCC (Atmel Studio)
- It is unsafe to create processes, mutexes, or call
malloc/freewithin running tasks. In fact, you have to be careful about the size of the block that you want to allocate usingmalloc; the size must be smaller than the free size of the task's stack. (We can add a system-side and preemptive safe allocation mechanism to prevent tasks from stack overflow).