当前位置:   article > 正文

linux系统乌班图18.04安装xenomai3.1,内核4.9.38_ipipe-core-4.9.38-x86-4.patch

ipipe-core-4.9.38-x86-4.patch

乌班图18.04安装xenomai3.1,内核4.9.38

乌班图系统:18.04
xenomai版本:3.1
linux内核:4.9.38

1,下载安装工具包

sudo apt update
  • 1
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
  • 1

安装会提示你内核的选择:选择第一个安装(install the package maintainer’s version)
在这里插入图片描述

mkdir XenomaiIgh
cd XenomaiIgh
  • 1
  • 2

2,下载linux内核及xenomai

2.1,下载linux内核

https://www.kernel.org/pub/linux/kernel/

wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.9.38.tar.gz
  • 1

2.2,下载xenomai

https://xenomai.org/downloads/xenomai/stable

wget https://xenomai.org/downloads/xenomai/stable/xenomai-3.1.tar.bz2
  • 1

2.3,下载补丁ipipe

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
  • 1

2.4,解压缩包

tar xf linux-4.9.38.tar.gz 
  • 1
tar xf xenomai-3.1.tar.bz2 
  • 1

3,打补丁

cd linux-4.9.38/
  • 1
cp -r ../ipipe-core-4.9.38-x86-4.patch ./
  • 1
../xenomai-3.1/scripts/prepare-kernel.sh --arch=x86_64 --ipipe=ipipe-core-4.9.38-x86-4.patch 
  • 1

4,配置内核

sudo make menuconfig
  • 1

推荐选择:

* 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)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50

5,编译内核

这里编译大概要两个小时左右,根据自己电脑性能有所差异。

sudo CONCURRENCY_LEVEL=$(nproc) make-kpkg --initrd kernel_image kernel_headers
  • 1

6,安装编译好的内核

cd ..
  • 1
sudo dpkg -i linux-headers-4.9.38-xenomai-3.1_4.9.38-xenomai-3.1-10.00.Custom_amd64.deb 
  • 1
sudo dpkg -i linux-image-4.9.38-xenomai-3.1_4.9.38-xenomai-3.1-10.00.Custom_amd64.deb
  • 1

7,添加xenomai 组

sudo addgroup xenomai --gid 1234
sudo addgroup root xenomai
sudo usermod -a -G xenomai $USER
  • 1
  • 2
  • 3

8,配置开机启动内核

sudo gedit /etc/default/grub
  • 1

8.1,修改内容:

在这里插入图片描述

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=""
  • 1
  • 2
  • 3
  • 4

8.2,更新内核并重启

sudo update-grub
sudo reboot
  • 1
  • 2

9,安装xenomai用户空间库程序

9.1,查询系统是否正确安装

uname -a
  • 1

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
  • 1

[ 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

9.2,安装用户空间程序

cd xenomai-3.1
  • 1
./script/bootstrap  //如果没有configure文件则执行此语句
  • 1
./configure --with-pic --with-core=cobalt --enable-smp --disable-tls --enable-dlopen-libs --disable-clock-monotonic-raw
  • 1
make -j`nproc`
  • 1
sudo make install  //默认安装在/usr/xenomai
  • 1

9.3,更新bashrc

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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

9.4,追加权限

sudo chmod -R 777 /dev/rtdm/memdev-private
sudo chmod -R 777 /dev/rtdm/memdev-shared
  • 1
  • 2

9.5,测试

sudo /usr/xenomai/bin/latency
  • 1

希望你没有遇见问题,一路顺风。
如果遇见的问题欢迎留言,一起交流解决。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/694571
推荐阅读
相关标签
  

闽ICP备14008679号