Discussion:
[Rtai] Method for compiling a driver for rtai, starting from the source of a general purpose driver
gianluca montarsolo
2018-08-14 16:51:44 UTC
Permalink
Hi!


it's possible to compile a driver for RTAI (example NVIDIA CUDA DRIVER) starting from general purpose driver's source code?


If it's possible, can I use it in kernal mode in order to execute e real time task that use a neural network?


Thanks!
Paolo Mantegazza
2018-08-15 13:57:36 UTC
Permalink
It is possible. In concept it is "simple" but it can result in an intimidating task.

Just to cite a few points.
You must must get rid of any Linux support in it, substituting it with RTAI services, possibly coding your own specific ones. For example, no Linux kernel memory allocation in real time, any Linux scheduling techniques must be translated to the RTAI way and so on.
You can keep the Linux syscalls (read, write, ioctl and so on) but must be able to intercept the ones specific to your driver, converting them to RTAI, through the use of the LXRT mechanisms, a simple matter.

Notice that what above may not need to be applied to the initialization phases, provided you will not carry them out in real time. Imposing that any initialization/closure is executed before working in real time saves a lot of work. Nonetheless it may not be acceptable always.

As said, my experience shows it to be possible, but requires an accurate study of the original Linux code, making it as if you coded it yourself. Than a lot of test-debugging to get rid from the little details (so called) you missed.

Till no true real time is needed, it may be useful to do a substantial part of the translation in a virtual machine.

Clearly the matter depends on the complexity of the driver itself. Personally, I have no experience with anything as complex as NVIDIA CUDA driver. I even did not know that a source version was available.

Paolo.

________________________________________
From: Rtai [rtai-***@rtai.org] on behalf of gianluca montarsolo [gianluca-***@hotmail.it]
Sent: Tuesday, August 14, 2018 6:51 PM
To: rtai-***@rtai.org; ***@rtai.org
Subject: [Rtai] Method for compiling a driver for rtai, starting from the source of a general purpose driver

Hi!


it's possible to compile a driver for RTAI (example NVIDIA CUDA DRIVER) starting from general purpose driver's source code?


If it's possible, can I use it in kernal mode in order to execute e real time task that use a neural network?


Thanks!

Loading...