Difference between revisions of "Xenomai"
(→Explanation of the process used to install Xenomai) |
(→Installing Xenomai) |
||
Line 9: | Line 9: | ||
==Installing Xenomai== | ==Installing Xenomai== | ||
− | {{Note|Xenomai has only be really tested on [[APF9328]] and [[APF27]] with 2.6.29 kernel. APF28 with 3.4 kernel and APF6 with 3.10 | + | {{Note|Xenomai has only be really tested on [[APF9328]] and [[APF27]] with 2.6.29 kernel. APF28 with 3.4 kernel and APF6/APF27 with 3.10 kernel are [[Talk:Xenomai|WiP]].}} |
===Lazy users=== | ===Lazy users=== | ||
* Starting from armadeus-6.0, some configurations are available to build Xenomai without configuring anything: | * Starting from armadeus-6.0, some configurations are available to build Xenomai without configuring anything: | ||
Line 16: | Line 16: | ||
or | or | ||
$ make apf27xenomai_defconfig | $ make apf27xenomai_defconfig | ||
+ | or | ||
+ | $ make apf27xenomaimainline_defconfig | ||
or | or | ||
$ make apf6xenomai_defconfig | $ make apf6xenomai_defconfig |
Latest revision as of 12:41, 30 April 2014
Contents
What is Xenomai ?
Xenomai is a real time co-kernel which cooperates with Linux via Adeos. With its help, hard real time applications can be developed and run on the Armadeus boards.
Thanks to Adeos, Xenomai will receive the interrupts first and decide to handle them or not. If not, they will then be transfered to the regular Linux kernel. Also, Xenomai provides a framework to develop applications which can be easily moved between the Real Time Xenomai environment and the regular Linux system.
Moreover, Xenomai provides a set of APIs (called "skins") that emulate traditional RTOSes such as VxWorks and pSOS and implement other APIs such as POSIX. Thus, porting third party real time applications to Xenomai is a fairly simple process.
Installing Xenomai
Note: Xenomai has only be really tested on APF9328 and APF27 with 2.6.29 kernel. APF28 with 3.4 kernel and APF6/APF27 with 3.10 kernel are WiP. |
Lazy users
- Starting from armadeus-6.0, some configurations are available to build Xenomai without configuring anything:
$ make apf9328xenomai_defconfig or $ make apf27xenomai_defconfig or $ make apf27xenomaimainline_defconfig or $ make apf6xenomai_defconfig
Manual installation
The main steps are:
- selection of Xenomai package on the Buildroot menuconfig,
- selection of Xenomai features in Kernel menuconfig,
- compilation of the new version,
- validation of the Xenomai behaviour.
Note: These steps must be done with a fresh view or, at least, after having deleted buildroot/output/build/linux-x.y.z directory. |
Selecting Xenomai package
- First of all, you need to select Xenomai package and Adeos patch in Buildroot menuconfig:
$ make menuconfig
... Kernel ---> Linux Kernel Extensions ---> [*] Adeos/Xenomai Real-time patch (ftp://ftp2.armadeus.com/armadeusw/adeos-ipipe-2.6.29-arm-1.13-05.patch) Path/url for Adeos patch file Target packages ---> Real-Time ---> [*] Xenomai Userspace (2.4.9) Custom Xenomai version for APF9328 & APF27 (--enable-arm-mach=mx2) Additionnal configuration options for APF27, on APF9328 use --enable-arm-mach=imx ...
- Exit and save your configuration
- If you plan to use xeno-test (Xenomai performance tool) then CONFIG_ASH_GETOPTS should be activated in Busybox:
$ make busybox-menuconfig
Shells ---> Choose your default shell (ash) ---> --- ash --- Ash Shell Options ... [*] Builtin getopt to parse positional parameters
- Exit and save your configuration
- rebuild Busybox & Buildroot:
$ make busybox-clean && make
Kernel greater than 2.6.29
2.6.38
Kernel ---> Linux Kernel Extensions ---> [*] Adeos/Xenomai Real-time patch (http://download.gna.org/adeos/patches/v2.6/$(BR2_ARCH)) Adeos patch URL (adeos-ipipe-2.6.38.8-arm-1.18-09.patch) Path for Adeos patch file
- If you plan to use a 2.6.38 kernel you have to delete the following patches :
$ cd patches/linux/2.6.38.8 $ rm 401-armadeus-fix_clock_tree.patch $ rm 419-armadeus-mx5fb-add_ipu_clock_polarity_support.patch
Xenomai kernel space support
- At first time, to have Linux kernel patched with Xenomai and Adeos patches, you must type:
$ make
- If the script prepare-kernel.sh is missing, you can resolve this issue by:
$ make xenomai
Then resume the compilation:
$ make
kernel-2.6.38
- If the compilation stops, which is probably the case for the first time, apply the following patches in : buildroot/output/build/linux-2.6.38.8
- adeos-00-avoid_kernel_panic.patch :
--- a/arch/arm/plat-mxc/time.c 2012-09-01 16:06:04.000000000 +0200 +++ b/arch/arm/plat-mxc/time.c 2012-09-01 16:01:17.000000000 +0200 @@ -405,7 +405,8 @@ if (timer_is_v1()) { tsc_info.u.counter_paddr = phys + MX1_2_TCN; - tsc_info.counter_vaddr =(unsigned long)(phys + MX1_2_TCN); + //tsc_info.counter_vaddr =(unsigned long)(phys + MX1_2_TCN); + tsc_info.counter_vaddr =(unsigned long)(timer_base + MX1_2_TCN); } else { tsc_info.u.counter_paddr = phys + V2_TCN; tsc_info.counter_vaddr = (unsigned long)(timer_base + V2_TCN);
- xenomai-00-move-irq_to_desc-export.patch :
diff -ru '--exclude-from=linux-2.6.38.8/Documentation/dontdiff' linux-2.6.38.8/kernel/irq/irqdesc.c linux-2.6.38.8.new/kernel/irq/irqdesc.c --- a/kernel/irq/irqdesc.c 2012-08-25 14:44:30.000000000 +0200 +++ b/kernel/irq/irqdesc.c 2012-08-25 12:17:44.000000000 +0200 @@ -268,13 +268,13 @@ } return arch_early_irq_init(); } -EXPORT_SYMBOL_GPL(irq_to_desc); #ifndef CONFIG_IPIPE struct irq_desc *irq_to_desc(unsigned int irq) { return (irq < NR_IRQS) ? irq_desc + irq : NULL; } +EXPORT_SYMBOL_GPL(irq_to_desc); #endif /* CONFIG_IPIPE */ struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node)
Configuring Xenomai
- You can configure the Xenomai kernel options from Linux menuconfig:
$ make linux-menuconfig
You should see the new entry :
Real-time sub-system --->
Enter in it and check the following to compile Xenomai as a part of the Linux kernel :
[*] Xenomai <*> Nucleus [*] Pervasive real-time support in user-space [ ] Interrupt shield support [*] Priority coupling support [*] Optimize as pipeline head (32) Number of pipe devices (512) Number of registry slots (128) Size of the system heap (Kb) (32) Size of the private stack pool (Kb) [*] Statistics collection [ ] Debug support [ ] Shared interrupts Timing ---> Scalability ---> Machine ---> Interfaces ---> Drivers --->
Additionaly, to enable / disable the different available skins, go into Interfaces ---> :
<*> Native API ---> <*> POSIX API ---> < > pSOS+ emulator ---> < > uITRON API ---> < > VRTX emulator ---> < > VxWorks emulator ---> < > RTAI emulator ---> <*> Real-Time Driver Model --->
Finally, to build your changes:
$ make linux && make
Deploy
You can now transfer the rootfs and the kernel on the APF.
Validate the installation
- Boot the APF and logon as root.
- You can double check Xenomai is installed correctly:
$ dmesg | grep Xenomai I-pipe: Domain Xenomai registered. Xenomai: hal/arm started. Xenomai: real-time nucleus v2.4.3 (Back to Shalla-Bal) loaded. Xenomai: starting native API services. Xenomai: starting POSIX services. Xenomai: starting RTDM services.
- Now we can run the overall+performance test provided by Xenomai:
# modprobe xeno_irqbench # modprobe xeno_klat # modprobe xeno_switchtest # modprobe xeno_timerbench # xeno-test
- On APF27 you have to unlock access to debug registers before launching these tests:
BIOS> run unlock_regs
Results
- latency (Sampling period: 100 us, test mode: periodic user-mode task, all results in microseconds)
Board ( Linux / xenomai ) | best | average | worst |
---|---|---|---|
APF27 (2.6.29 / 2.4.9) | 4.7 uS | 52.4 uS | 145.4 uS |
Deinstalling or disabling Xenomai
There are two parts needed for disabling Xenomai features
Kernel
For disabling kernel part, two solutions are available
- The first solution is to unselect kernel's features :
$ make linux-menuconfig
And disable following options:
Real-time sub-system ---> [ ] Xenomai and Kernel Features ---> [ ] Interrupt pipeline
- The second solution is to destroy the kernel tree :
$ make linux-dirclean
Userspace / package
For disabling userspace/package part :
$ make menuconfig
and disable Xenomai
Package Selection for the target ---> [ ] Xenomai
then use the dirclean command:
$ make xenomai-dirclean