lxrt question - dynamical loading of code at runtime into lxrt application

Jan Kiszka kiszka at rts.uni-hannover.de
Thu Oct 21 11:43:53 CEST 2004

Hello Max,

> Hi,
> my question is lxrt design related.
> We have an application, it's real time control, until now we are using 
> kernel space. The question is how i could port that to lxrt.
> We are dynamically loading multiple exchangeable controllers at runtime 
> for our different plants on one machine. In kernel mode this can be done 
> by loading a module.
> Since the kernel is basically one namespace, by knowing the right 
> function names in other modules we plug into the framework of our other 
> communication/logging/IPC modules.
> I'm aware on how to port all the other modules and the driver for the 
> DAQ card which will be running all the time. But how can i load a module 
> (or any other piece of code) into an lxrt enabled program in user space 
> at runtime ?
> Has anybody else done a similar thing with lxrt ?
> Or even better, anybody has examples, bits of code etc. ?

Especially for handling dynamic driver/application relations, we have 
drafted and implemented a thin registration model for real-time Linux 
(RTDM - Real-Time Driver Model). See my announcement on the rtai-dev and 
the RTnet list 
You can find the working reference implementation in RTnet since release 
0.7.0 (rtnet.sf.net).

The RTAI implementation of the model allows a driver module (kernel) to 
offer its services to both kernel and LXRT real-time applications. The 
drivers functionality has to be mapped either on the POSIX I/O model 
(open/close/read/write/ioctl) or on POSIX sockets 
(socket/close/sendmsg/recvmsg/...). Therefore, you have two namespaces, 
clear-text names for the first class, address families and socket types 
for the second one.

You can find the RTDM code in 
Unfortunately, I still didn't find the time to re-write the original 
specification reflecting the implemented model. But if you have 
questions, feel free to ask.


PS: There is currently an ongoing effort by one of the RTnet developers 
to extend RTDM with a select mechanism, thus allowing to wait on 
multiple events with a single task.

More information about the Rtai mailing list