xenomai 在ubuntu上的安装测试
2016-12-07 21:08
375 查看
在ubuntu下安装安装xenomai试试系统,
背景:
1、全新的ubuntu系统,我安装了一些必要的软件比如gcc g++等等
2、版本信息为:
由于xenomai没有针对3.19的补丁xenomai仅支持特定版本的几个内核因此,我们需要修改ubuntu的内核到指定的版本。因此我们需要做两件事情
1、 给ubuntu换新的内核
2、 安装xenomai2.6
首先就需要下载xenomai源码了,为了和其他的程序兼容我们选择xenomai2.6
下载网址在这里http://git.xenomai.org/xenomai-2.6.git/
这里就选择2.6.4
背景:
1、全新的ubuntu系统,我安装了一些必要的软件比如gcc g++等等
2、版本信息为:
hello@hello-Lenovo:~$ cat /etc/issue Ubuntu 14.04.4 LTS \n \l hello@hello-Lenovo:~$ uname -a Linux hello-Lenovo 3.19.0-58-generic #64~14.04.1-Ubuntu SMP Fri Mar 18 19:05:42 UTC 2016 i686 i686 i686 GNU/Linux
由于xenomai没有针对3.19的补丁xenomai仅支持特定版本的几个内核因此,我们需要修改ubuntu的内核到指定的版本。因此我们需要做两件事情
1、 给ubuntu换新的内核
2、 安装xenomai2.6
首先就需要下载xenomai源码了,为了和其他的程序兼容我们选择xenomai2.6
下载网址在这里http://git.xenomai.org/xenomai-2.6.git/
这里就选择2.6.4
hello@hello-Lenovo:~/work/ubuntu$ wget http://download.gna.org/xenomai/stable/xenomai-2.6.4.tar.bz2[/code]
下载完毕之后就可以解压了:hello@hello-Lenovo:~/work/ubuntu$ tar -xf xenomai-2.6.4.tar.bz2
解压完毕进入xenomai源码:hello@hello-Lenovo:~/work/ubuntu/xenomai-2.6.4$ cd xenomai-2.6.4
此时我们需要一些工具,进行安装:hello@hello-Lenovo:~/work/ubuntu/xenomai-2.6.4$ sudo apt-get install devscripts devscripts debhelper dh-kpatches findutils autotools-dev autoconf automake libtool
安装完毕之后,就可以进行配置,主要配置选项如下:--prefix xenomai的安装目录默认的是/usr/xenomai --enable-debug 使能调试符号-g默认的是不使能 -enable-smp 使能xenomai库对SMP的支持 ,假如客户端的应用运行在支持SMP的内核上一定要使能。 --with-atomic-ops= 这个是个选择使用何种方式进行原子访问操作:假如--with-atomic-ops=builtins 则选择使用GCC的嵌入的部件,比如 _sync*()等函数;假如--with-atomic-ops=ad-hoc则选择使用xenomai方式实现。假如用户没有指定的话,编译的时候除非GCC是过时的,否则默认选择--with-atomic-ops=builtins --enable-x86-sep 使能x86sep指令 --enable-x86-tsc 使能x86的tsc --enable-arm-tsc 使能arm 的tsc,为了提高时钟精确度,一般选择使能 --enable-arm-quirks 使能一些arm片上系统特殊特性,目前支持sa1100和xscale3。
配置完毕之后,就可以进行编译了,我们使用默认的配置的就可以了,配置如下:./configure --enable-x86-sep
假如在其他的平台上使用就需要根据文档依次来进行对应的配置了。
配置完毕之后,接下来我们编译hello@hello-Lenovo:~/work/ubuntu/xenomai-2.6.4$ make
完成之后安装hello@hello-Lenovo:~/work/ubuntu/xenomai-2.6.4$ makeinstall
xenomai暂时完毕接下来开始编译内核。
下面开始编译内核,此时也需要安装几个工具:hello@hello-Lenovo:~/work/ubuntu/xenomai-2.6.4$ sudo apt-get install kernel-package libncurses-dev fakeroot zlib1g-dev
接下来下载源码包然后解压:hello@hello-Lenovo:~/work/ubuntu$ wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.17.tar.xz && tar -xf linux-3.14.17.tar.xz
等待解压完毕进入内核目录:hello@hello-Lenovo:~/work/ubuntu$ cd linux-3.14.17/
然后就可以打补丁了hello@hello-Lenovo:~/work/ubuntu/linux-3.14.17$ ../xenomai-2.6.4/scripts/prepare-kernel.sh --arch=amd64 --linux=. --adeos=../xenomai-2.6.4/ksrc/arch/x86/patches/ipipe-core-3.14.17-x86-4.patch
接下来配置下
这里我为了方便,直接把之前的配置拷贝到当前的目录下,这样做是简单,但是可能会出错,不过就算出错也是有些不该配置的地方配置了,此时只要根据提示修改即可,拷贝命令如下:hello@hello-Lenovo:~/work/ubuntu/linux-3.14.17$ cp /boot/config-$(uname -r) ./
接下来需要配置一些宣讲Make menuconfig
下面是一些选项:必选项: * Real-time sub-system --> Xenomai (Enable) --> Nucleus (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) 可选项 (RECOMMENDED): * General setup --> Local version - append to kernel release: -xenomai-2.6.5 --> Timers subsystem --> High Resolution Timer Support (Verify you have HRT ON) * Pocessor type and features --> Processor family --> SMT (Hyperthreading) scheduler support (Disable) --> Preemption Model --> Voluntary Kernel Preemption (Desktop) * Power management and ACPI options --> Memory power savings --> Intel chipset idle memory power saving driver
配置完毕之后就可以进行编译了,执行:hello@hello-Lenovo:~/work/ubuntu/xenomai-2.6.4$ make bzImage -j4
编译完成之后就可以进行安装了:hello@hello-Lenovo:~/work/ubuntu/xenomai-2.6.4$ make install
假如需要编译安装模块的话,需要hello@hello-Lenovo:~/work/ubuntu/xenomai-2.6.4$ make modules -j4
装模块hello@hello-Lenovo:~/work/ubuntu/xenomai-2.6.4$ makemodules_install
到此为止就安装完成了,其实在make install完毕之后就可以通过执行update-grub还查看启动项了
比如:hello@hello-Lenovo:/usr$ sudo update-grub [sudo] password for hello: Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.19.0-58-generic Found initrd image: /boot/initrd.img-3.19.0-58-generic Found linux image: /boot/vmlinuz-3.19.0-25-generic Found initrd image: /boot/initrd.img-3.19.0-25-generic Found linux image: /boot/vmlinuz-3.14.17 Found initrd image: /boot/initrd.img-3.14.17 Found linux image: /boot/vmlinuz-3.14.17.old Found initrd image: /boot/initrd.img-3.14.17 Found memtest86+ image: /boot/memtest86+.elf Found memtest86+ image: /boot/memtest86+.bin Found Windows Vista (loader) on /dev/sda1 Done
看到上面就出现vmlinuz-3.14.17了,说明已经成功了接下来hello@hello-Lenovo:/usr$ sudo reboot now
再启动界面上选择ubuntu 高级选项
然后选择对应的版本号就可以了。
接下来进入系统之后进行测试:hello@hello-Lenovo:/usr$ sudo xeno latency == Sampling period: 100 us == Test mode: periodic user-mode task == All results in microseconds warming up... RTT| 00:00:01 (periodic user-mode task, 100 us period, priority 99) RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst RTD| -2.446| 0.371| 4.774| 0| 0| -2.446| 4.774 RTD| -2.144| 0.276| 4.826| 0| 0| -2.446| 4.826 RTD| -2.348| 0.344| 4.762| 0| 0| -2.446| 4.826 RTD| -2.756| 0.273| 4.682| 0| 0| -2.756| 4.826 RTD| -2.376| 0.338| 5.793| 0| 0| -2.756| 5.793 RTD| -2.549| 0.296| 4.411| 0| 0| -2.756| 5.793 RTD| -2.356| 0.340| 6.218| 0| 0| -2.756| 6.218 RTD| -2.248| 0.271| 4.756| 0| 0| -2.756| 6.218 RTD| -2.557| 0.341| 4.789| 0| 0| -2.756| 6.218 RTD| -2.359| 0.284| 9.107| 0| 0| -2.756| 9.107 RTD| -2.603| 0.341| 4.778| 0| 0| -2.756| 9.107 RTD| -1.402| 0.268| 4.723| 0| 0| -2.756| 9.107 RTD| -2.418| 0.328| 4.774| 0| 0| -2.756| 9.107 RTD| -1.074| 0.268| 5.534| 0| 0| -2.756| 9.107 RTD| -1.060| 0.337| 5.480| 0| 0| -2.756| 9.107 RTD| -1.682| 0.271| 5.514| 0| 0| -2.756| 9.107 RTD| -2.531| 0.336| 4.742| 0| 0| -2.756| 9.107 RTD| -2.490| 0.263| 4.741| 0| 0| -2.756| 9.107 RTD| -2.575| 0.340| 5.598| 0| 0| -2.756| 9.107 RTD| -2.319| 0.265| 4.718| 0| 0| -2.756| 9.107 RTD| -2.484| 0.335| 4.978| 0| 0| -2.756| 9.107 RTT| 00:00:22 (periodic user-mode task, 100 us period, priority 99)
原文地址
http://blog.csdn.net/woshidahuaidan2011/article/details/53510510
参考文献:
https://launchpad.net/ubuntu/+source/xenomai/2.6.2.1-2ubuntu2
http://rtt-lwr.readthedocs.io/en/latest/rtpc/xenomai.html
http://support.barrett.com/wiki/BuildingAKernel/Ubuntu14.04-Kernel3.14.17-Xenomai2.6.4#PatchingtheKernel
http://support.barrett.com/wiki/BuildingAPC/14-04-1_64_Install
相关文章推荐
- Ubuntu下安装Tokyo Cabinet和Tokyo Tyrant, 并测试pytyrant
- ubuntu9.04下Sun JAVA JDK JRE安装(绝对通过测试)
- 在Ubuntu下安装、配置和测试cuda
- 怎样在ubuntu中安装C和C++编译器并测试你第一个C和C++程序
- mysql-proxy 在UBUNTU 下安装和测试
- 在UBUNTU上安装CodeBlocks的方法(测试可行,解决7.10依赖的问题)
- (转)怎样在ubuntu中安装C和C++编译器并测试你第一个C和C++程序
- Ubuntu上使用autotest做Rails项目的自动测试 - autotest安装和测试
- Thrift 学习笔记1——Ubuntu环境下Thrift的安装、编译以及测试
- 转】ubuntu 11.10 安装wine qq2012 [精][亲自测试能过
- Ubuntu下面安装NS2(已经测试)
- ubuntu server 安装测试sendmail
- Oracle10gR2在Ubuntu10.10下的安装配置及链接测试
- AWS (Amazon Web services) 免费主机测试使用流程 – 安装Ubuntu
- Ubuntu下安装FFmepg和SDL以及测试
- 在Ubuntu在安装SkyEye及测试
- Ubuntu下安装Tokyo Cabinet和Tokyo Tyrant, 并测试pytyrant
- Ubuntu下GTK的安装、编译和测试
- Ubuntu下单机安装MongoDB并测试
- ubuntu中安装apache ab命令进行简单压力测试