Page 1 of 1
Trying different scheduling algorithms in erika OS
Posted: Tue Jan 07, 2020 6:50 am
by saydam
Hello everybody, this is my first post.
I was impressed by the work of Paolo Gai.
I will embed erika to arduino uno, but i want to try different scheduling algorithms(e.g. Round robin, SJF, FCFS).
My purpose is evaluating the performance of scheduling algorithms.
Could i try this ? Is it possible ?
If it is possible, how can i do that, is there a document ?

Re: Trying different scheduling algorithms in erika OS
Posted: Thu Jan 09, 2020 9:37 am
by paolo.gai
Hi,
Thanks for your compliments, not only to me but to the whole team who is working on ERIKA.
About the support of additional scheduling algorithms: ERIKA3 has the parts related to the scheduler separated in separate files. You can try to change them, but it will not be as easy as it was in Shark (
http://shark.sssup.it).
My suggestion would be to start with an existing demo, compile it. then understand where are the functions (search for example for ee_oo_sched*.c), and then modify them. The thing which is lacking in ERIKA3 is a time support like we had in Shark, this was very useful when designing the time handling and the handling of the wake up points....
Ciao,
PJ
Re: Trying different scheduling algorithms in erika OS
Posted: Thu Mar 26, 2020 10:36 am
by saydam
Actually, now i think to try time trigger architecture and event trigger architecture on my arduino.
I know erika supports Earliest Deadline First (EDF) as event trigger architecture.
I can call tasks with static schedule table with the aid of alarms.
Then, can we say Erika supports time trigger architecture ?
Re: Trying different scheduling algorithms in erika OS
Posted: Thu Mar 26, 2020 7:43 pm
by paolo.gai
Hi,
EDF was supported on ERIKA2, not yet ported to ERIKA3.
For a time triggered implementation, you should try with emulating it with a Schedule table...
PJ
Re: Trying different scheduling algorithms in erika OS
Posted: Sun Apr 12, 2020 9:14 pm
by saydam
Hi,
I downloaded VirtualBox for Erika v2 and i rearranged the oil and cpp file according to EDF configuration like
https://erika.tuxfamily.org/wiki/index. ... _scheduler.
However i took this error:
Code: Select all
22:11:24 **** Incremental Build of configuration Default for project Event_Trigger_Architecture ****
/home/evidence/workspace/Event_Trigger_Architecture/Debug/make_launcher.bat all
Using erika files in /home/evidence/Erika_SVN/
CC eecfg.c
CXX code.cpp
In file included from /home/evidence/Erika_SVN//pkg/ee.h:179:0,
from /home/evidence/workspace/Event_Trigger_Architecture/code.cpp:41:
/home/evidence/Erika_SVN//pkg/mcu/atmel_atmega/inc/ee_mcu.h: In function 'EE_TIME EE_hal_gettime()':
/home/evidence/Erika_SVN//pkg/mcu/atmel_atmega/inc/ee_mcu.h:279:24: error: 'EE_timer_1_get' was not declared in this scope
return EE_timer_1_get();
^
/home/evidence/workspace/Event_Trigger_Architecture/code.cpp: In function 'int main()':
/home/evidence/workspace/Event_Trigger_Architecture/code.cpp:65:17: error: 'EE_timer1_init' was not declared in this scope
EE_timer1_init();
^
/home/evidence/workspace/Event_Trigger_Architecture/code.cpp:66:18: error: 'EE_timer1_start' was not declared in this scope
EE_timer1_start();
^
make: *** [obj/code.o] Error 1
22:11:32 Build Finished (took 7s.392ms)
I know this error for not defining __TIMER_1_USED__ . I also define as EE_OPT but there is no change at error. How should i make a change in code to avoid this error ?
My oil file
Code: Select all
CPU mySystem {
OS myOs {
EE_OPT = "DEBUG";
CPU_DATA = AVR8 {
APP_SRC = "code.cpp";
APP_SRC = "task.c";
MULTI_STACK = FALSE;
};
MCU_DATA = MEGA {
MODEL = MEGA_328p;
};
EE_OPT = "__ARDUINO_SDK__";
EE_OPT = "__ARDUINO_UNO_328__";
/* EE_OPT = "__ARDUINO_NANO_328__"; */
/* Used to build separate libarduino.a */
EE_OPT = "__ADD_LIBS__";
LIB = ENABLE {
NAME = "ARDUINO_SDK";
};
KERNEL_TYPE = EDF {
TICK_TIME = "125 ns";
};
};
COUNTER SystemTimer {
MINCYCLE = 1;
MAXALLOWEDVALUE = 65535;
TICKSPERBASE = 1;
TYPE = HARDWARE {
DEVICE = "TIMER1_COMPA";
SYSTEM_TIMER = TRUE;
};
SECONDSPERTICK = 0.001;
};
ALARM myAlarm {
COUNTER = SystemTimer;
ACTION = ACTIVATETASK { TASK = TaskL1; };
};
TASK TaskL1 {
PRIORITY = 1;
STACK = SHARED;
SCHEDULE = FULL;
REL_DEADLINE = "10 ms";
};
};
My cpp file
Code: Select all
#include "ee.h"
#include "Arduino.h"
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
void loop(void)
{
ActivateTask(TaskL1);
}
void setup(void)
{
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
int main(void)
{
EE_mcu_init();
init();
EE_timer1_init();
EE_timer1_start();
#if defined(USBCON)
USBDevice.attach();
#endif
setup();
for (;;) {
loop();
if (serialEventRun) serialEventRun();
}
return 0;
}