搭建xenomai的步骤比preempt rt patch要复杂一些,本节介绍xenomai的cobalt模式,既宏微内核。
1,分别下载
linux-4.4.43
ipipe-core-4.4.43-x86-6.patch
xenomai-3.0.3
2,给kernel打ipipe相关的patch
cd linux-4.4.43
patch:./xenomai-3.0.3/scripts/prepare-kernel.sh --linux=linux-4.4.43 --ipipe=ipipe-core-4.4.43-x86-6.patch --arch=x86_64
3, 配置内核:
cp /boot/config-4.4.189 .config
make menuconfig -- 做如下修改:
* General setup
--> Local version - append to kernel release: -xenomai-3.0.5
--> Timers subsystem
--> High Resolution Timer Support (Enable)
* Xenomai/cobalt
--> Sizes and static limits
--> Number of registry slots (512 --> 4096)
--> Size of system heap (Kb) (512 --> 4096)
--> Size of private heap (Kb) (64 --> 256)
--> Size of shared heap (Kb) (64 --> 256)
--> Maximum number of POSIX timers per process (128 --> 512)
--> Drivers
--> RTnet
--> RTnet, TCP/IP socket interface (Enable)
--> Drivers
--> New intel(R) PRO/1000 PCIe (Enable)
--> Realtek 8169 (Enable)
--> Loopback (Enable)
--> Add-Ons
--> Real-Time Capturing Support (Enable)
* Power management and ACPI options
--> CPU Frequency scaling
--> CPU Frequency scaling (Disable)
--> ACPI (Advanced Configuration and Power Interface) Support
--> Processor (Disable)
--> CPU Idle
--> CPU idle PM support (Disable)
* Pocessor type and features
--> Enable maximum number of SMP processors and NUMA nodes (Disable)
// Ref : http://xenomai.org/pipermail/xenomai/2017-September/037718.html
--> Processor family
--> Core 2/newer Xeon (if "cat /proc/cpuinfo | grep family" returns 6, set as Generic otherwise)
// Xenomai will issue a warning about CONFIG_MIGRATION, disable those in this order
--> Transparent Hugepage Support (Disable)
--> Allow for memory compaction (Disable)
--> Contiguous Memory Allocation (Disable)
--> Allow for memory compaction
--> Page Migration (Disable)
* Device Drivers
--> Staging drivers
--> Unisys SPAR driver support
--> Unisys visorbus driver (Disable)
4,编译内核:
make
sudo make modules_install
sudo make install
sudo update-grub
5,配置和编译xenomai
./configure --with-core=cobalt --enable-smp --enable-pshared
sudo make install
note:--with-core应该选cobalt
6,重启,选新编好的xenomai内核
7,测试
一下两种工具都可以使用。
1)cyclictest
2) /usr/xenomai/bin/latency
参考:https://blog.csdn.net/whatamadman/article/details/75676334
https://gitlab.denx.de/Xenomai/xenomai/wikis/Installing_Xenomai_3
https://stackoverflow.com/questions/41949678/installation-steps-for-xenomai-3-on-ubuntu-16-04