赞
踩
乌班图18.04安装xenomai3.1,内核4.9.38
乌班图系统:18.04
xenomai版本:3.1
linux内核:4.9.38
sudo apt update
sudo apt-get install gcc git make automake build-essential libncurses5-dev bison flex libssl-dev kernel-package git-core flex bison texinfo zip unzip zlib1g-dev gettext libfuse-dev fuse-emulator-gtk pkg-config findutils debhelper libtool libltdl-dev
安装会提示你内核的选择:选择第一个安装(install the package maintainer’s version)
mkdir XenomaiIgh
cd XenomaiIgh
https://www.kernel.org/pub/linux/kernel/
wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.9.38.tar.gz
https://xenomai.org/downloads/xenomai/stable
wget https://xenomai.org/downloads/xenomai/stable/xenomai-3.1.tar.bz2
https://xenomai.org/downloads/ipipe/v4.x/x86/
wget https://xenomai.org/downloads/ipipe/v4.x/x86/ipipe-core-4.9.38-x86-4.patch
tar xf linux-4.9.38.tar.gz
tar xf xenomai-3.1.tar.bz2
cd linux-4.9.38/
cp -r ../ipipe-core-4.9.38-x86-4.patch ./
../xenomai-3.1/scripts/prepare-kernel.sh --arch=x86_64 --ipipe=ipipe-core-4.9.38-x86-4.patch
sudo make menuconfig
推荐选择:
* General setup
--> Local version - append to kernel release: -xenomai-3.1
--> Timers subsystem
--> High Resolution Timer Support (Enable)
* Xenomai/cobalt
--> Sizes and static limits
--> Number of registry slots (512 --> 4096)
--> Size of system heap (Kb) (4096 --> 4096)
--> Size of private heap (Kb) (256 --> 256)
--> Size of shared heap (Kb) (256 --> 256)
--> Maximum number of POSIX timers per process (256 --> 512)
--> Drivers
--> RTnet
--> RTnet, TCP/IP socket interface (Enable)
--> Drivers
--> New intel® PRO/1000 PCIe (Enable)
--> Realtek 8169 (Enable)
--> Loopback (Enable)
--> Add-Ons
--> Real-Time Capturing Support (Enable)
---> Real-time IPC drivers(Enable) //点击两下空格,要*,不要M
---> RTIPC protocol family(Enable)
---> XDDP cross-domain datagram protocol(Enable)
---> IDDP intra-domain datagram protocol(Enable)
---> Number of IDDP communication ports (32)
---> Buffer protocol(Enable)
---> Number of BUFP communication ports (32)
* 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)
--> Processor family
--> Core 2/newer Xeon (if “cat /proc/cpuinfo | grep family” returns 6, set as Generic otherwise)
--> Transparent Hugepage Support (Disable)
--> Allow for memory compaction (Disable)
--> Contiguous Memory Allocation (Disable)
--> Page Migration (Disable)
* Device Drivers
--> Staging drivers
--> Unisys SPAR driver support
--> Unisys visorbus driver (Disable)
这里编译大概要两个小时左右,根据自己电脑性能有所差异。
sudo CONCURRENCY_LEVEL=$(nproc) make-kpkg --initrd kernel_image kernel_headers
cd ..
sudo dpkg -i linux-headers-4.9.38-xenomai-3.1_4.9.38-xenomai-3.1-10.00.Custom_amd64.deb
sudo dpkg -i linux-image-4.9.38-xenomai-3.1_4.9.38-xenomai-3.1-10.00.Custom_amd64.deb
sudo addgroup xenomai --gid 1234
sudo addgroup root xenomai
sudo usermod -a -G xenomai $USER
sudo gedit /etc/default/grub
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 4.9.38-xenomai-3.1"
GRUB_TIMEOUT=5
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash xenomai.allowed_group=1234"
GRUB_CMDLINE_LINUX=""
sudo update-grub
sudo reboot
uname -a
Linux hh 4.9.38-xenomai-3.1 #1 SMP Mon Nov 22 16:06:55 CST 2021 x86_64
x86_64 x86_64 GNU/Linux
dmesg | grep Xenomai
[ 0.817060] [Xenomai] scheduling class idle registered. [
0.817061] [Xenomai] scheduling class rt registered. [ 0.817081] [Xenomai] SMI-enabled chipset found, but SMI workaround disabled [
0.817392] I-pipe: head domain Xenomai registered. [ 0.818573] [Xenomai] allowing access to group 1234 [ 0.818625] [Xenomai]
Cobalt v3.1
cd xenomai-3.1
./script/bootstrap //如果没有configure文件则执行此语句
./configure --with-pic --with-core=cobalt --enable-smp --disable-tls --enable-dlopen-libs --disable-clock-monotonic-raw
make -j`nproc`
sudo make install //默认安装在/usr/xenomai
echo '
### Xenomai
export XENOMAI_ROOT_DIR=/usr/xenomai
export XENOMAI_PATH=/usr/xenomai
export PATH=$PATH:$XENOMAI_PATH/bin:$XENOMAI_PATH/sbin
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$XENOMAI_PATH/lib/pkgconfig
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$XENOMAI_PATH/lib
export OROCOS_TARGET=xenomai
' >> ~/.xenomai_rc
echo 'source ~/.xenomai_rc' >> ~/.bashrc
source ~/.bashrc
sudo chmod -R 777 /dev/rtdm/memdev-private
sudo chmod -R 777 /dev/rtdm/memdev-shared
sudo /usr/xenomai/bin/latency
希望你没有遇见问题,一路顺风。
如果遇见的问题欢迎留言,一起交流解决。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。