[LinuxCNC/linuxcnc PR#110] “uspace plus”: uspace with support for preempt-rt, rtai, and xenomai

未分类 bolang 4个月前 (10-15) 33次浏览

Issue #110 | 状态: 已关闭 | 作者: jepler | 创建时间: 2016-07-14

标签: enhancement portability


Part of the original design of uspace realtime is that there is a base class “RtapiApp” which can be subclassed for other RTOSes that fit within the userspace model. But until now there is just one subclass, PosixApp.

In this PR, I implement two new subclasses: RtaiApp (which uses the RTAI LXRT API) and XenomaiApp (which uses the Xenomai POSIX skin API). Each class is around 200 LOC and is dynamically loaded with dlopen() based on the running kernel.

In a short test, without trying to stress the RTOS, I get latencies similar to RTAI with kernel modules.

!linuxcnc-uspace rtai

This is far from ready to actually be merged. Additional work to be done includes (but is not limited to)
– [x] scripts/realtime: now need to load/unload modules for uspace+rtai realtime
– [x] configure: now need to detect paths (includes, libs, module locations) for rtai, xenomai
– [x] packaging: install right build dependencies
– [x] safe path for rtapi_print\* out of realtime
– [x] fix any other non-realtime syscalls being made (e.g., clock_gettime)
– [ ] get feedback from other testers
– [x] placate buildbot

To run it you need to:
1. Install an appropriate realtime kernel plus rtai-modules (for rtai) or libxenomai-dev and xeno-runtime (for xenomai)
2. Check that the RTOS works separately from LinuxCNC.
1. For RTAI, Check if the tests/user/latency test from rtai works with your system. (for me it required sudo ./run)
2. For xenomai, try sudo xeno latency
3. Configure this tree --with-realtime=uspace, make, sudo make setuid
4. . scripts/rip-environment
5. python -c 'import hal; print hal.isrt, hal.isuserspace should print 1 1.
6. Now you should be able to run halrun, latency-test, latency-histogram, linuxcnc
1. The type of RTOS used is printed on the terminal, e.g., Note: Using XENOMAI (posix-skin) realtime


评论 (1)

#1 – jepler 于 2016-07-29

Merged


原始Issue: https://github.com/LinuxCNC/linuxcnc/pull/110

喜欢 (0)