This project is a Real-Time Operating System (RTOS) implemented for the ARM Cortex family. It includes features such as task scheduling, mutexes, and more.
- Priority-based Scheduling: Tasks are scheduled based on their priority levels.
- Task States: Tasks can be in one of the following states:
Suspended
,Waiting
,Ready
,Running
. - AutoStart: Tasks can be configured to start automatically.
- Mutual Exclusion: Mutexes are used to prevent multiple tasks from accessing shared resources simultaneously.
- Priority Inversion Handling: The system handles priority inversion scenarios.
- ARM Cortex development environment
- C compiler (e.g., GCC for ARM)
- Clone the repository:
git clone https://github.com/OmarZakaria10/My-Real-Time-Operating-System.git
- Navigate to the project directory:
cd My-Real-Time-Operating-System
- Compile and Flash the compiled binary to your ARM Cortex device.
- Reset the device to start the RTOS.
Tasks are defined and created in the main.c
file. Here is an example:
#include "Scheduler.h"
void task1() {
// Task code here
}
int main(void) {
TASK Task1;
Task1.Stack_Size = 1024;
Task1.p_TaskEntry = task1;
Task1.Priority = 1;
strcpy(Task1.TaskName, "task_1");
MYRTOS_CreateTask(&Task1);
MYRTOS_ActivateTask(&Task1);
MYRTOS_StartOS();
while (1) {
// Main loop
}
}