我是在i9 9900k的主机上编译的linux内核、xenomai以及ethercat igh。生成的文件如下:
在这里插入图片描述
这是我编译好的上述4个文件,我传到了CSDN。
我基于i5 4460进行了测试。

参考文献

https://rtt-lwr.readthedocs.io/en/latest/rtpc/xenomai.html
https://rtt-lwr.readthedocs.io/en/latest/rtpc/xenomai3.html

材料

linux内核:3.14.44
xenomai2.6.5
ipipe-core-3.14.44-x86-11.patch
ubuntu
ethercat igh

一些安装包
sudo apt-get install build-essential libncurses5-dev bison flex libssl-dev
sudo apt-get install kernel-package
//下面的可以不用安装
$ sudo apt-get install build-essential git-core libncurses5-dev libssl-dev
$ sudo apt-get install flex bison texinfo zip unzip zlib1g-dev gettext 
$ sudo apt-get install gperf libsdl-dev libesd0-dev libwxgtk2.6-dev 
$ sudo apt-get install uboot-mkimage 
$ sudo apt-get install g++ xz-utils
//ubuntu右键打开终端
sudo apt-get install  nautilus-open-terminal
更换源
sudo gedit /etc/apt/sources.list

//删除原有内容替换为
deb http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ precise main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ precise-security main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ precise-updates main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ precise-proposed main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ precise-backports main restricted universe multiverse

sudo apt-get update

第一步 打补丁

./scripts/prepare-kernel.sh --linux=/home/vmuser/workspace/linux-3.14.44 \
--ipipe=/home/vmuser/workspace/xenomai-2.6.5/ipipe-core-3.14.44-x86-11.patch --arch=x86_64

第二步 配置menuconfig

* General setup
  --> Local version - append to kernel release: -xenomai-2.6.5
  --> Timers subsystem
      --> High Resolution Timer Support (Enable)
* Real-time sub-system
  --> Xenomai (Enable)
  --> Nucleus (Enable)
      --> Pervasive real-time support in user-space (Enable)
* Power management and ACPI options
  --> Run-time PM core functionality (Disable)
  --> ACPI (Advanced Configuration and Power Interface) Support
      --> Processor (Disable)
  --> CPU Frequency scaling
      --> CPU Frequency scaling (Disable)
  --> CPU idle
      --> CPU idle PM support (Disable)
* Pocessor type and features
  --> Processor family
      --> Core 2/newer Xeon (if \"cat /proc/cpuinfo | grep family\" returns 6, set as Generic otherwise)
* Power management and ACPI options
  --> Memory power savings
      --> Intel chipset idle memory power saving driver (Disable)

* Real-time sub-system
  --> Number of registry slots
      --> 4096
  --> Size of the system heap
      --> 2048 Kb
  --> Size of the private stack pool
      --> 1024 Kb
  --> Size of private semaphores heap
      --> 48 Kb
  --> Size of global semaphores heap
      --> 48 Kb
**********************************************************************************************************
* Processor type and features
[ ] Linux guest support  ---- 
[ ] Multi-core scheduler support
* Power management and ACPI options
[ ] Suspend to RAM and standby 
[ ] Hibernation (aka 'suspend to disk') 
* Processor type and features
[ ] Transparent Hugepage Support
[ ] Contiguous Memory Allocator
[ ] Allow for memory compaction
[ ]   Page migration

第三步 编译、安装内核

在i9 9900k上编译内核,生成linux-headers-xxx.deb和linux-image-xxx.deb安装包。

//编译内核
sudo CONCURRENCY_LEVEL=$(nproc) make-kpkg --initrd kernel_image kernel_headers
//CONCURRENCY_LEVEL=$(nproc) make-kpkg --rootcmd fakeroot --initrd kernel_image kernel_headers

在i5 4460上安装内核、并进行测试。

//安装内核
sudo dpkg -i linux-headers-3.14.44-xenomai2.6.5_3.14.44-xenomai2.6.5-10.00.Custom_amd64
sudo dpkg -i linux-image-3.14.44-xenomai2.6.5_3.14.44-xenomai2.6.5-10.00.Custom_amd64

sudo gedit /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="text"
#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
sudo update-grub

第四步 编译xenomai

cd xenomai-2.6.5
./script/bootstrap //如果没有configure文件则执行此语句
./configure --enable-smp
make 
sudo make install  //默认安装在/usr/xenomai

第五步 编译igh

进入igh目录

./bootstrap
./configure --with-linux-dir=/home/vmuser/3.14.44_2.6.5/linux-3.14.44 \
--enable-generic=yes --enable-8139too=yes --enable-e1000=yes --enable-e1000e=yes --enable-r8169=yes \
--enable-rtdm=yes --enable-cycles=yes --enable-hrtimer=yes --with-xenomai-dir=/usr/xenomai

make
make modules
make install
sudo make modules_install

接下来的步骤和我的这一篇内容一样了《ubuntu14.04、xenomai3.1、ethercat igh构建主站(1)》

Logo

更多推荐