赞
踩
安装相关库:sudo apt-get install gcc git libncurses5-dev make flex bison libssl-dev libelf-dev automake
(1)ipipe补丁:tar
-xvf linux-4.4.182.tar.xz
cd linux-4.4.182/
patch -p1 < ../ipipe-core-4.4.182-x86-15.patch
(2)xenomai补丁:
tar -xvf xenomai-3.0.10.tar.bz2
cd xenomai-3.0.10
./scripts/prepare-kernel.sh --linux=/home/myc/vx/igh/linux-4.4.182 --arch=x86_64 --outpatch=../xenomai-3.0.10.patch
cd linux-4.4.182/
patch -p1 < ../xenomai-3.0.10.patch
(3)编译内核:
cd linux-4.4.182/
cp /boot/config-4.4.0-176-generic .config
make menuconfig
make bzImage -j4
make modules -j4
(4)安装:
make INSTALL_MOD_STRIP=1 modules_install
sudo mkinitramfs /lib/modules/4.4.182/ -o /boot/initrd.img-4.4.182-xenomai
sudo cp arch/x86/boot/bzImage /boot/vmlinuz-4.4.182-xenomai
sudo cp System.map /boot/System.map-4.4.182-xenomai
sudo update-grub2
cd xenomai-3.0.10
./configure --with-core=cobalt --enable-smp --enable-pshared
./configure --with-core=cobalt --enable-smp --enable-pshared CFLAGS="-fPIC"
sudo make install
(5)实时性:sudo /usr/xenomai/bin/latency
# 原生版本igh
unzip ethercat-master.zip
cd ethercat-master/
./bootstrap
./configure --with-linux-dir=/home/aruogan/igh/linux-4.4.182 --with-module-dir=/lib/modules/4.4.182-xenomai/ --enable-generic --enable-igb --enable-rtdm --with-xenomai-dir=/usr/xenomai --enable-cycles --enable-hrtimer --enable-8139too=no
sudo make #编译
sudo make modules #编译模块
sudo make install #安装
sudo make modules_install #安装模块
sudo mkdir /etc/sysconfig #创建文件夹
sudo cp /usr/local/etc/sysconfig/ethercat /etc/sysconfig/ #复制配置文件
sudo cp /usr/local/etc/init.d/ethercat /etc/init.d/ #复制启动脚本
sudo chmod a+x /etc/init.d/ethercat
sudo update-rc.d ethercat defaults
sudo gedit /etc/udev/rules.d/99-EtherCAT.rules(KERNEL=="EtherCAT[0-9]*", MODE="0664", GROUP="users" )
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。