Questions tagged [rtai]

Short for RTAI LXRT. Synonym with LXRT. Real-time extension of the Linux Kernel.

RTAI LXRT is a modification to the Linux kernel that allows real-time threads to be run.

24 questions
9
votes
2 answers

Porting user space code to kernel space

I have a big system written mostly in C that was running in user space up till now. Now I need to compile the code as a kernel module. For that, afaik, I should at least rewrite the code and replace functions as malloc, calloc, free, printf with…
eris
  • 129
  • 6
4
votes
4 answers

How to avoid FPU when given float numbers?

Well, this is not at all an optimization question. I am writing a (for now) simple Linux kernel module in which I need to find the average of some positions. These positions are stored as floating point (i.e. float) variables. (I am the author of…
Shahbaz
  • 46,337
  • 19
  • 116
  • 182
2
votes
2 answers

How do I access(open/read/etc) /dev devices from a kernel module?

I have received a driver (PCAN driver for PCI card, using rtdm), that creates /dev/pcan0 and /dev/pcan1 is compiled as a netdev driver. There are many facilities that come with this driver, but they are all targeted at a user-level program reading…
Shahbaz
  • 46,337
  • 19
  • 116
  • 182
2
votes
1 answer

What can cause C code to crash when an array is initialised at declaration, but not crash if zeroed by a loop?

A bug has recently been "fixed" in a project I work on, but so far nobody has been able to explain why the fix works. (So is it really a fix?) The code is running in kernel space under a realtime system, so the problem causes a complete system…
bodgesoc
  • 191
  • 9
2
votes
0 answers

Unified Shared Memory Systems

I am working with some older real-time control system code written using the RTAI extensions to Linux. I see four different mechanisms in use to create and share memory across process boundaries. 1) RTAI shared memory (rt_shm_alloc &…
Speed8ump
  • 1,307
  • 10
  • 25
1
vote
1 answer

Should I join a thread that has been killed?

I have many joinable threads that at some point need to all stop. The threads are pthread, but are created through RTAI's user-space interface (never mind the RTAI though). For each thread I have a variable that I can set to tell them to quit. So…
Shahbaz
  • 46,337
  • 19
  • 116
  • 182
1
vote
0 answers

In a crash dump how should I interpret an instruction pointer offset?

I am trying to debug a kernel module. I have compiled it with -g and I am logging with netconsole. In the output I see: [ 575.335966] RIP: 0010:switch_rtai_tasks+0x329/0x428 [rtai_sched] Which I understand to mean that the problem [575.335942]…
bodgesoc
  • 191
  • 9
1
vote
1 answer

rtai 4.1 linux kernel 3.10.32 recipe for target 'deb-pkg' failed

RTAI4.1 installation for ubuntu 16.04 when i compile kernel 3.10.32 in my ubuntu 16.04(x86-64) following command which i execute: patch for kernel cd /usr/src/linux patch -p1 <…
wengle
  • 11
  • 3
1
vote
1 answer

how create a makefile for program.c and how to compile and execute in Real Time Application Interface

I have a hollowworld.c : /* hello.c */ #include #include MODULE_LICENSE("GPL"); int init_module(void) { printk("Hello world!\n"); /* printk = kernel printf, to the console */ return 0; } void…
BkarimCe
  • 65
  • 7
1
vote
1 answer

Serial Port: How to adjust serial port buffer size in kernel space

I need to know how to adjust serial port buffer size in kernel space. ioctl and similar commands do not work in kernel space. I am using RTAI functions. rt_spopen, rt_spwrite else.. Reason of my wish relies on sending large packets (367 byte) over…
mexes
  • 23
  • 7
1
vote
0 answers

serial port is hostage of writer thread

I have two real-time threads(linux) First one is to send bytes over serial port (kernel space) Second one is to read the same bytes(because i used loop-back device) from serial port. First thread sends data continuously and asynchronously,…
mexes
  • 23
  • 7
0
votes
1 answer

How do you detect whether the calling thread of a function is already RTAI real-time?

I am working on a big project that uses RTAI both in kernel and user spaces. I won't get into the details of the project, but here is briefly where a problem arises. In user-space, my project provides a library used by other people to write some…
Shahbaz
  • 46,337
  • 19
  • 116
  • 182
0
votes
1 answer

How can this function do "write" operation without writing in "Transmitter Register"?

Here's the code from rt_imx_uart.c : static ssize_t rt_imx_uart_write(struct rtdm_fd *fd, const void *buf, size_t nbyte) { struct rt_imx_uart_ctx *ctx; rtdm_lockctx_t lock_ctx; size_t written = 0; int free; int…
Iron Baby
  • 13
  • 1
0
votes
0 answers

RTAI:module kernel that write a data structure

I'm trying to write a kernel module with rtai that allows me to write a data structure. The data structure is contained in a .h file and contains information about the tasks, for example file .h struct control{ int priorirty; unsigned long…
0
votes
1 answer

what hardware is actually necessary for RTAI 4.1?

I've been struggling with this for a while, and may be at the point of purchasing a new computer, so I figured I'd check if anyone knew. In configuring RTAI 4.1 on ubuntu 14.04 with a 3.10.32 kernel (as advised by a few souces, mainly:…
aperson
  • 11
  • 1
1
2