Xenomai-forge 自述

AI权益加码!Claude Code、Cursor等20+工具免费用! 购周边限时加赠Coding Plan Lite,畅享主流AI工具!学习进阶更高效! 阅读详情
Xenomai-forge Readme
Xenomai-forge 自述

This is Xenomai 3.x, the upcoming architecture of the Xenomai RTOS emulation system, which can run seamlessly as a dual kernel (i.e. like Xenomai 2.x, I-pipe based), or over mainline Linux kernels (likely PREEMPT-RT enabled though).
这是Xenomai 3.x,即将到来的Xenomai RTOS模拟系统的架构,它能够无缝运行如一个双内核(基于I-pipe技术的Xenomai 2.x),或者完全在Linux内核之上(启用PREEMPT-RT)。

This new architecture therefore exhibits two real-time cores, selected at build time. The dual kernel core inherited from the Xenomai 2.x architecture is nicknamed "Cobalt". The native linux core inherited from the former Xenomai/SOLO work is called "Mercury".
这个新架构呈现了两个实时核心,在编译阶段被选定。从Xenomai 2.x继承而来的双内核架构的核心被昵称为"Cobalt"。从Xenomai/SOLO继承而来的原生的Linux核心被称为"Mercury"。

This magic works with the introduction of the "Copperplate" interface, which mediates between the real-time API/emulator your application uses, and the underlying real-time core. This way, applications are able to run in either environments without visible change.
这种神奇来自于"Copperplate"接口的介绍,它介于你的应用程序使用的实时API/模拟器和实时核心之间。应用程序能够被运行在任何环境,没有显而易见的改变。

This is experimental, work in progress, very much in flux code. The basic design won't change anymore though. Not all features we want to see there are available yet.
这是实验性的,渐近的,改进非常快的代码。基本的设计将不会被改变。并非我们想看到的所有的特征都已经具备了。

Performance-wise, we have no figure yet. However, this new design is known to significantly reduce the number of user/kernel transitions due to system calls on average compared to the 2.x architecture, which can't be bad.
我们还没有性能方面的路线图。然而,众所周知,这种新的设计显著降低了为了处理系统调用(和2.x架构的平均的比较)而导致用户/内核转换的次数,它不可能会是坏的。

Prerequisites  先决条件
=================
-- To run over the Cobalt core
--要运行在Cobalt核心

All like in the old days, as one used to bring up a Xenomai 2.x system, i.e:
象昔日使用Xenomai 2.x系统一样。

1. An interrupt pipeline patch which fits your hardware. Recent ones are readily available from the Xenomai source tree (see kernel/cobalt/arch/*/patches). All existing patches can be found at http://download.gna.org/adeos/patches/
1.一个匹配你的硬件的中断管道线的补丁。最新的补丁来自于Xenomai的源代码树(查看 kernel/cobalt/arch/*/patches)。所有存在的补丁能够在http://download.gna.org/adeos/patches/找到。
2. A working port of the Cobalt core to the target architecture. We intend to support the same set as available with Xenomai 2.6.x.
2.一个能够将Cobalt 核心移植到目标架构的移植案例。我们打算和Xenomai 2.6.x兼容。
 
-- To run over the Mercury core
--要运行在Mercury核心

1. A recent glibc featuring the NPTL thread library, with priority inheritance support for mutexes (PTHREAD_PRIO_INHERIT).
1.一个最近的glibc优先配备了NPTL线程库,具备支持互斥的优先级继承功能(PTHREAD_PRIO_INHERIT)。

2. Ideally, a real-time capable Linux kernel with the PREEMPT_RT support enabled. Non real-time kernels can be used too, likely for basic debugging tasks, and/or applications which do not have strict real-time requirements.
2.理想的情况下,一个具有PREEMPT_RT实时能力的Linux内核被启用。非实时内核也是可以被使用的,如为了
基本的调试任务,和(或)不需要严格实时要求的应用。

Compiling the Cobalt core  编译Cobalt核心
===============================

Same as Xenomai 2.6.x for the in-kernel part. Check out http://git.xenomai.org/?p=xenomai-head.git;a=blob;f=README.INSTALL;h=f9727c226b58e26b328a572f54712d034b8f8a65;hb=HEAD

Then, configure, build and install the user-space libraries and executables, passing --with-core=cobalt to the configure script. See below.
然后,传递--with-core=cobalt给配置脚本,配置,编译和安装用户空间库和执行文件。请看下面。

Compiling the Mercury core 编译Mercury核心
=================================

There is no Xenomai-specific kernel bits currently, until we have enabled the native RTDM support and drivers.  So for now, you just need to configure, build and install the user-space libraries and executables, passing --with-core=mercury to the configure script. See below.
目前这里没有Xenomai指定内核点位,我们已经能够启动Native RTDM支持和驱动程序。因此在当前,你仅仅需要传递--with-core=cobalt给配置脚本,配置,编译和安装用户空间库和执行文件。请看下面。
Compiling the user-space libraries and executables (both cores) 编译用户空间库和可执行文件(双核心)
============================================================================
This code base has been autoconf-iscated, so building it is pretty simple, e.g.:
代码基础已经被自动配置,因此编译它是相当的简单。
 
$ mkdir build-dir
$ cd build-dir
$ ../xenomai-forge/configure --with-core=<cobalt|mercury> <other-options>
$ make
$ make install [DESTDIR=/staging/dir]


Where <other-options> may be any standard autoconf switch, such as:
这里<other-options>可以是任何标准autoconf开关,诸如:

--prefix=<dir>


 To specify the runtime path for the installation of libraries, include files, scripts and executables. "make install" installs these files to ${DESTDIR}/<dir>.


 This directory defaults to /usr/xenomai.


or Xenomai-specific knobs:


--enable-debug[=full]

 This switch will enable debug mode, causing debug symbols to be compiled in the libraries and executables, passing the -g flag to the compiler to get debug symbols. When enabled, this switch also causes the __XENO_DEBUG__ macro to be defined, for both the Xenomai core and the applications getting their C
 compilation flags from the xeno-config script (i.e. xeno-config --cflags).  Debug mode is off by default.


 If the full debug level is specified along with this switch, -O0 is passed to the compiler, to disable the optimizer. In
 addition, the macro __XENO_DEBUG_FULL__ is also defined.


 Over the Mercury core, enabling debug mode also causes the standard malloc interface to be used internally instead of a fast real-time allocator (TLSF). This allows debugging memory-related issues with the help of Valgrind or other dynamic memory analysers.


--enable-assert

 A number of debug assertion statements are wired into the  Xenomai core, which aim at checking the internal consistency of the emulation system during runtime (see man assert(3)). Passing --disable-assert to the configure script disables built-in assertions. Assertions are enabled by default.


--enable-pshared


 Enable shared multi-processing. When enabled, this option  allows multiple processes to share real-time objects
 (e.g. tasks, semaphores).


--enable-registry


 Some Xenomai APIs can export their internal state through a  pseudo-filesystem, which files may be read to obtain
 information about the existing real-time objects, such as  tasks, semaphores, message queues and so on.  This feature is  supported by FUSE, which must be available on the target  system. Building the Xenomai core with the registry support  requires the FUSE development libraries to be installed on the  build system.


 When this option is enabled, the emulator creates a file  hierachy under /mnt/xenomai/<pid> (by default), where you can  access the internal state of the active real-time  objects. E.g. looking at the properties of a VxWorks task
 could be done as follows:


 $ cat /mnt/xenomai/12656/vxworks/tasks/windTask 
 name       = windTask
 errno      = 0
 status     = ready
 priority   = 70
 lock_depth = 0


 You may override the default mount point of the registry hierarchy by using the --registry-mountpt runtime option (see below).


 NOTE: the FUSE-based registry support is still in its early  stage, and only a few objects are currently exported, only by  the VxWorks API when running over the Mercury core. This is  work in progress, so don't expect too much yet.


 When running over the Cobalt core however, the /proc/xenomai  interface is available for inspecting the core system state  (i.e. nucleus and RTDM), like with Xenomai 2.x.


--enable-lores-clock


 Enable low resolution clock. By default, both cores are built  with support for tick-based timing. If you don't actually
 require such support and only use tickless real-time APIs,  then you can use --disable-lores-clock to optimize out this  support.


--enable-clock-monotonic-raw


 The Xenomai core requires a monotonic clock to be available  from the underlying POSIX interface. When CLOCK_MONOTONIC_RAW  is available on your system, you may want to pass this switch,  otherwise CLOCK_MONOTONIC will be used by default.


 NOTE: Cobalt implements CLOCK_MONOTONIC_RAW, so this clock is  turned on by default when building with
 --with-core=cobalt. However, the Mercury core turns this off  by default, since we don't know in advance whether this  feature exists on the target kernel.


Compiling an application 编译一个应用程序
================================


Like with Xenomai 2.x, you should use the xeno-config script to get the proper compilation and linker flags related to Xenomai, for building your application, for whichever core. Here is a Makefile fragment fetching the compilation and linker flags for building a VxWorks-based application, over the Xenomai emulator:


 XENO_CONFIG := /usr/xenomai/bin/xeno-config
 CFLAGS := $(shell $(XENO_CONFIG) --skin=vxworks --cflags)
 LDFLAGS := $(shell $(XENO_CONFIG) --skin=vxworks --ldflags)


Running a Xenomai 3.x application 运行一个Xenomai 3.x应用程序
===============================================


For Cobalt, you need Xenomai's Cobalt dual kernel bits built in the target kernel. The build procedure is identical to Xenomai 2.x.
对于Cobalt,你需要被编译进目标内核的Xenomai's Cobalt 双内核点位。构建过程是和Xenomai 2.x相同的。


For Mercury, you need no Xenomai-specific kernel support so far, beyond what your host Linux kernel already provides. Your kernel should at least provide high resolution timer support (CONFIG_HIGH_RES_TIMERS), and ideally complete preemption (PREEMPT_RT) if your application requires short and bounded latencies.
对于Mercury,你不再需要Xenomai指定内核支持,由于你的主机Linux内核已经提供了。如果你的应用程序需要短期的和有限延迟性能,你的内核至少需要提供高精度定时器支持(CONFIG_HIGH_RES_TIMERS),和理想情况下完全抢占(PREEMPT_RT) 。


An application recognises a set of options that may be passed on the command line, namely:


--<api>-clock-resolution=<ns>


 The clock resolution available with the API, given as a count of nano-seconds, i.e. HZ=(1000000000 / ns). <api> is the name of one of the existing Xenomai 3.x APIs your application can be linked against, e.g. psos, vxworks or alchemy. When your application combines multiple APIs, you can pass several clock-resolution switches to set them all.

 The default value depends on the API.


--mem-pool-size=<kb>


 The initial size in Kilobytes of the main memory pool. This option only makes sense when the TLSF allocator is being used (i.e. --enable-debug is not specified when compiling the Xenomai core). This is only a hint, since TLSF will increase the main pool size dynamically as needed, if needed. However, this option may be used to pre-allocate the specified amount of memory to the application process, thus avoiding costly system calls to extend the data segment of such process while operating in time critical mode.


--no-mlock


 Tells the Xenomai core not to lock the process memory while initializing. The application will have to handle this task when and how it sees fit, in order to avoid the extra latency induced by virtual memory paging.  Otherwise,
 mlockall(MCL_CURRENT | MCL_FUTURE) is automatically invoked by the Xenomai core as part of the emulator initialization duties.


--registry-mountpt=<path>


 Tells the emulator to mount the object registry over the given path, instead of /mnt/xenomai/<pid> by default (see the --enable-registry switch from the build time options).


--no-registry


 This switch disables registry support at runtime. No real-time objects will be exported to /mnt/xenomai/<pid>, despite the registry code has been compiled in.


--session=<name>


 Name of the session the new process will be part of (or create if not present). This is only useful when --enable-pshared was passed at build time, to allow multiple processes to operate on remote objects. e.g. allowing a process to post a semaphore created by another process within the same session. This is done using a common heap area, shared by all processes within the same session.


--reset


 Force removal of an older session. This only works if the process which created the shared heap for the former session has exited, otherwise an error is raised.


--cpu-affinity=<cpu[,cpu]...>


 Set CPU affinity of threads created by the Xenomai core within the new process.


--enable-async-cancel
 Allow threads to be cancelled asynchronously. When disabled, threads are deleted only when they reach specific cancellation points (like system calls). Defaults to enabled.


Available emulators/APIs  可用的模拟器/API
================================

VxWorks:
See lib/vxworks/README.
VxWorks is a registered trademark of Wind River Systems, Inc (http://www.windriver.com).
VxWorks:
查看lib/vxworks/README。
VxWorks是风河系统公司的注册商标 (http://www.windriver.com)。

pSOS:
See lib/psos/README.
pSOS is a registered trademark of Wind River Systems, Inc (http://www.windriver.com).
pSOS:
查看lib/psos/README。
pSOS是风河系统公司的注册商标 (http://www.windriver.com)。

Alchemy:
This is a re-implementation of Xenomai's former "native" API, fully rebased on the new RTOS emulation core. This is work in progress.
Alchemy:
这是一个重新执行的Xenomai形式的Native API,完全基于新的RTOS模拟核心。这是正在进行的工作。

Wed Sep 21 11:54:54 CEST 2011
by <rpm@xenomai.org>
Ubuntu18.04安装xenomai3.1.x实时系统笔记 1、安装必备工具包 1.1、安装gcc软件包 sudo apt install gcc 1.2、安装git软件包 sudo apt install git 1.3、安装界面编程库 sudo apt install libncurses5-dev 1.4、安装make工具包 sudo apt install make 1.5、安装词法语法分析包 sudo apt-get install flex bison 1.6、安装SSL工具包 sudo apt install libssl-dev 1.7、安装ELF. 阅读详情

相关推荐

Xenomai 3.1的错误记录

POSIX可移植操作系统接口(Portable Operating System Interface of UNIX) POSIX标准意在期望获得源代码级别的软件可移植性。换句话说,为一个POSIX兼容的操作系统编写的程序,应该可以在任何其它的POSIX操作系统(即使是来自另一个厂商)上编译执行。 如下是makefile文件: SKIN=alchemy //皮肤设置 MAIN_SRC=periodicTask//对应任务的名字 TARGET=periodicTask LM=-lm CFLAGS :

weixin_44991673的博客 2199

Xenomai (学习笔记)

文章目录1. 简介1.1 实时OS1.2 Adeos域 (Domain)中断管道(Interrupt Pipe)事件管道(event pipeline)乐观的中断保护系统事件传播基于Linux的实现1.3 Adeos为Xenomai提供的服务Xenomai的主要和次要域名系统调用拦截中断传播启用/禁用中断源在域之间共享中断中断共享和延迟结论Xenomai用户层实时的实现(TSC)Xenomai多API构架(skin)Xenomai的应用接口在Cobalt和LInux之间迁移线程Real-Time Drive

pwl999的博客 2万+

Banana Pi BPI-Forge1开发板开箱测评:瑞芯微RK3506J芯片能玩出什么花样?

本文深度测评了Banana Pi BPI-Forge1开发板,重点解析了其搭载的瑞芯微RK3506J工业级芯片在智能语音、多媒体处理与工业控制等垂直领域的应用潜力。该板以双网口、丰富音频接口及2D图形加速为核心,配合轻量级Buildroot系统,为创客和工程师提供了一个稳定、专注且高性价比的开源硬件开发平台。

day7的博客 412

如何编译和安装Xenomai-forgeLinux系统(Fedora 14)

[rtems@silver build]$ ../configure -h  //配置脚本的情况 `configure' configures Xenomai 2.6.0 to adapt to many kinds of systems. Usage: ../configure [OPTION]... [VAR=VALUE]... To assign environment var

CyberLabs的专栏 2774

Xenomai+igh的编译问题

求助大佬解决igh连接Xenomai过程中的undefined reference to `rt_dev_ioctl'问题

qq_44905936的博客 2318

Xenomai-forge Native API概述

Xenomai-forge Native API概述 本文档的目的 本文档旨在提供一个关于Xenomai的Native API的通用浏览。新用户应该发现关于这个接口背后的逻辑的设计信息。本文档应该是API参考手册的有益补充。 这个API是做什么的? 由于Xenomai是内在不可知的API,它能够运行各种特性的接口,比如VxWorks, pSOS+, uITRON或者VRTX那样的模拟器,模

CyberLabs的专栏 2219

Xenomai-forge Tasks and IRQ example

#include #include #include #include #include #define IRQ_NUMBER 7  /* Intercept interrupt #7 */ #define TASK_STKSZ 0 /* Stack size (use default one) */ #define TASK_PRIO 99 /* Highest

CyberLabs的专栏 1728

Ubuntu18.04/20.04编译Linux5.10.76+Xenomai-3.2.1+IgH

叙述了Linux-5.10.76+Xenomai-v3.2.1+IgH的安装过程,根据参考资料,编译的源码可以在ubuntu20.04上使用。

qq_28882933的博客 2万+

Ubuntu16.04 Xenomai3.x 系列移植笔记----测试与编程

目录 构建一个xenomai 3 应用 编译一个基于rtdm的模块 运行应用程序 运行一个xenomai 3应用 实时的I / O的支持 关于RTnet RTnet相关特性 RTnet 基本要素 RTnet 配置文件 RTnet 测试 RTnet编程代码 构建一个xenomai 3 应用 详细的构建与安装见https://gitlab.denx.de/Xenomai/xe...

gu655366的博客 3529

【超级详细步骤】Xenomai内核配置选项解决Xenomai/cobalt (NEW)下多种警告的问题

All the steps we have followed is in the website:https://gitlab.denx.de/Xenomai/xenomai/-/wikis/Installing_Xenomai_3 Preparing the Cobalt kernel First,we would like to prepare the Cobalt kernel using following instruction in Xenomai 3.x file. We used to m

weixin_44991673的博客 2993

5.3.2 Xenomai3:使用xeno-config获取编译和链接参数

xeno-config是一个辅助脚本,用于为使用Xenomai库的应用程序提供正确的编译和链接标志。通过这个工具,开发者可以轻松获取所需的编译器选项和链接器参数,确保应用程序能够正确地集成到Xenomai环境中。

三问Linux社区 1537

xenomai」xeno-config脚本的使用

xenomai」xeno-config脚本的使用

HAICHANG1105的博客 1084

xenomai内核解析--双核系统调用(二)--应用如何区分xenomai/linux系统调用或服务

版权声明:本文为本文为博主原创文章,转载请注明出处。如有错误,欢迎指正。 1. 引出问题 上一篇文章xenomai内核解析–双核系统调用(一)以X86处理器为例,分析了xenomai内核调用的流程,读了以后可能会觉得缺了点什么,你可能会有以下疑问: 系统中的两个内核都是POSIX接口实现系统调用,那么我写一个POSIX接口的应用程序,怎样知道它调用的内核,或者说怎样成为运行在cobalt内核的RT应用,而不是普通linux应用? 对于同一个POSIX接口,可能我的程序中,既需要xenomai内核提供服务(

wsg1100 1574

树莓派4b安装xenomai3(xenomai3 on raspberry4b)

树莓派4b安装xenomai3

Doro_的博客 3235

编译 linux kernel + xenomai 2/3(在orocos中需要注意资源配置)

尊重原作,从github拷贝的,以免翻墙或者找不到。 原作链接:https://github.com/kuka-isir/rtt_lwr/blob/rtt_lwr-2.0/docs/source/rtpc/xenomai.rstXenomai 2.6.5 on Ubuntu 14.04/16.04Nvidia Drivers are NOT supported (creates a lot of

all for one,one for all 8748

Xenomai3.0.5+Linux4.9.24安装及配置

https://blog.csdn.net/whatamadman/article/details/75676334 Xenomai3.0.5+Linux4.9.24安装及配置 1.下载Linux内核:https://www.kernel.org/pub/linux/kernel/ 下载对应要使用内核的I-pipe补丁:http://xenomai.org/downloads/ipipe/ 2....

Linux Android Web 1881

基于X86架构的EhterCAT主站控制器安装方法-3-Xenomai 编译、安装、实时性测试(x86)

【代码】基于X86架构的EhterCAT主站控制器安装方法-3-Xenomai 编译、安装、实时性测试(x86)

PlutoZuo的博客 380

【Ubuntu18.04使用Xenomai补丁】<linux-4.9.38+xenomai-3.2.1>

【Ubuntu18.04使用Xenomai补丁】<linux-4.9.38+xenomai-3.2.1>

m0_57145940的博客 694
上一篇: 基于Xenomai的实时Linux分析与研究
下一篇: 如何编译和安装Xenomai-forge到Linux系统(Fedora 14)
CyberLabs
博客等级 码龄15年 143粉丝 7原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值