By following the tutorial in Ev3, one who is interested to run Linux on Ev3 should be able to have Debian with 3.16.7 linux kernel with the internet feature. For the research/lecture usage, I start to patch 4.10 Linux kernel and litmus-RT on it. I will list and update the possible delights for some of students who are just starting to develop Linux kernel stuffs.
If in Ev3dev wget fails, please add on
Ref:http://www.tecmint.com/install-kernel-3-16-in-debian/
As far as we can find, https://www.youtube.com/watch?v=PGy5XrI6lLs provides the video about how to patching Linux kernel for LitmusRT. The tutorial in installation page (https://wiki.litmus-rt.org/litmus/InstallationInstructions) is missing the command for the newbie who is lacking experience of linux tools:
The version is 3.10 in the video. There must be some tiny bug if one directly follows it for the latest version 4.10 (as the trace option is involved). The bug [ref] is in the caller of __dynamic_dev_dbg function in usb driver as102, i.e., drivers/media/usb/as102/as102_usb_drv.c. To fix it, please add "&" before bus_adap->usb_deb->dev in line 117 and 135:
In addition, there is another bug in init/do_mounts.o failed, so far I haven't yet to fix it on Ev3.
If you get the warning that clock skew detected, it should be fixed by using the following commands to update the date on EV3:
date -s mm/dd/yy
date -s hh:mm:ss
--------------- LEGO Mindstorms Real-Time Operating System -------------
First of all, nxtOSEK is not good enough, as it lacks the ability of fully preemption.
We can find out a project that try to solve the problem: http://moss.csc.ncsu.edu/~mueller/rt/rt14/projects/p1/report4.pdf
Quote:"The nxtOSEK
kernel has been purposefully designed to prevent successive instances
of preemption i.e. the kernel does not support a case where after one
preemption event, while the preempting task is yet to finish its
execution, it is preempted in turn by an even higher priority task. In
this project, we attempted to resolve this by modifying the current
kernel behavior. ..."
In EV3, OSPERT'14 has a workshop paper, which is also the producer of nxtOSEK:
proceedings/ospert14- proceedings.pdf
However, the developer said it is out-of-date and not compatible with recent arm-none-eabi
compilers. In fact, a new platform called EV3RT now is released. You can find more information here (http://ev3rt-git.github.io/ and http://dev.toppers.jp/trac_ user/ev3pf/wiki/WhatsEV3RT) (in Japanese).
If in Ev3dev wget fails, please add on
--no-check-certificate
in the option before the download link.Ref:http://www.tecmint.com/install-kernel-3-16-in-debian/
As far as we can find, https://www.youtube.com/watch?v=PGy5XrI6lLs provides the video about how to patching Linux kernel for LitmusRT. The tutorial in installation page (https://wiki.litmus-rt.org/litmus/InstallationInstructions) is missing the command for the newbie who is lacking experience of linux tools:
sudo apt-get install build-essential kernel-package \ libncurse5-dev bzip2 fakeroot \And use the following command for wrapping the kernel as deb package file:
fakeroot make-kpkg --initrd --append-to-version=-litmusRT \ kernel-image kernel-headers
The version is 3.10 in the video. There must be some tiny bug if one directly follows it for the latest version 4.10 (as the trace option is involved). The bug [ref] is in the caller of __dynamic_dev_dbg function in usb driver as102, i.e., drivers/media/usb/as102/as102_usb_drv.c. To fix it, please add "&" before bus_adap->usb_deb->dev in line 117 and 135:
dev_dbg(bus_adap->usb_dev->dev, ...It should becomes to:
dev_dbg(&bus_adap->usb_dev->dev, ...In fact, the author of LitmusRT answer the question: https://lists.litmus-rt.org/pipermail/litmus-dev/2016/001219.html
In addition, there is another bug in init/do_mounts.o failed, so far I haven't yet to fix it on Ev3.
If you get the warning that clock skew detected, it should be fixed by using the following commands to update the date on EV3:
date -s mm/dd/yy
date -s hh:mm:ss
--------------- LEGO Mindstorms Real-Time Operating System -------------
First of all, nxtOSEK is not good enough, as it lacks the ability of fully preemption.
We can find out a project that try to solve the problem: http://moss.csc.ncsu.edu/~mueller/rt/rt14/projects/p1/report4.pdf
However, the project to the end is not able to fix the problem:
Quote:
"We weren't able to demonstrate successful return to the preempted task
after the high priority task finishes its execution. Instead, we
observed the controller getting reset after the completion of the higher
priority task. We couldn't resolve this due to limited debug/simulation
capabilities."In EV3, OSPERT'14 has a workshop paper, which is also the producer of nxtOSEK:
"A Platform for LEGO Mindstorms EV3 Based on an RTOS with MMU Support"
https://www.mpi-sws.org/~bbb/However, the developer said it is out-of-date and not compatible with recent arm-none-eabi
compilers. In fact, a new platform called EV3RT now is released. You can find more information here (http://ev3rt-git.github.io/ and http://dev.toppers.jp/trac_
May I ask whether you succeeded in patching the EV3 kernel with the Litmus-RT patch?
ReplyDeleteI'm sorry that at the end we couldn't boot it :( To the end, we choose to use a new distribution called EV3OSEK.
DeleteReal-time linux may be more easier to deploy https://rt.wiki.kernel.org/index.php/Main_Page on EV3dev.
DeleteThank you very much for your reply.
DeleteGreat that you mention EV3OSEK. I'm the project leader (or principal investigator so to say). My students and me are always happy to help with ev3osek. Just get in touch...
I could also send you the project report providing details about porting nxtOSEK to EV3. Just drop me a line...
Since EV3OSEK is currently missing a driver for the Mindstorm's LCD display and nxtOSEK has a bug (as you pointed out to us (https://github.com/ev3osek/ev3osek/issues/8)), I'm currently looking into the RT Preempt patch for Linux (as you suggested). I managed to patch the ev3dev kernel. However, some drivers do not work reliably (Wifi, USB). I'm still looking into this issue. You may want to have a look here: https://github.com/ev3dev/ev3dev/issues/779
:) I didn't notice that you are the person I talked to.
DeleteI have one good but one bad news about the preemption in EV3OSEK (Just found it yesterday): The nested preemption problem somehow is gone but the context switch has a flaw. The first guess is that the values in the registers are not stored properly. Therefore, when the execution of preempted task is resumed, the elapsed processing is gone.
May I have your project report about your porting? I think I can make some efforts there :) I can give you more detailed about the observation we have. My email: kuan-hsun.chen@tu-dortmund.de