Skip to contentSkip to conversation

Writing a new driver, shoud use message pipes or shared memory?

Xenomai-help Carlos Eduardo de Brito Novaes 3 participants 7 messages Jun 30, 2011 – Jul 3, 2011

lore
Share & tools
lore
#0 lore raw

Hello all!
Hope this question fits to the scope of the list.

I got a PCI acquisition board and wish to write a xenomai driver for it. I had did this before with an old ISA board and used memory heaps to exchange data from kernel (configuration and mainly acquisition routines) and the real time processing task.

Now, I would like to know if I can use only message pipes for this kind of application. I would like to use it so the entire proccess became more "unix like", using memory heaps I think that the internals of the driver are exposed and the any misfuncion can arise due to bad data passed from programmers. Is this right?

Can message pipes provide hard real time timings, about 1K/10K samples per second and about 100 bytes on each sample?

Thanks

Carlos Novaes.

#1 lore raw
Quoted 8 lines · Carlos Eduardo de Brito Novaes

Hello all!
Hope this question fits to the scope of the list.

I got a PCI acquisition board and wish to write a xenomai driver for it. I had did this before with an old ISA board and used memory heaps to exchange data from kernel (configuration and mainly acquisition routines) and the real time processing task.

Quoted 8 lines

Now, I would like to know if I can use only message pipes for this kind of application. I would like to use it so the entire proccess became more "unix like", using memory heaps I think that the internals of the driver are exposed and the any misfuncion can arise due to bad data passed from programmers. Is this right?

Can message pipes provide hard real time timings, about 1K/10K samples per second and about 100 bytes on each sample?

Hi,

you probably should use the RTDM skin to write a driver. So, use the "read" call to get data, or if there is a big volume, use some mmaped aread, using rtdm_mmap_to_user.

Regards.

Signature · 1 line
                                                                Gilles.
#2 lore raw

Re: [Xenomai-help] Writing a new driver, Skin differences.

Hello,

I think I the question on using memory mapped are solved. Now I was wondering and cant find a big difference over the four skins, at least for a new project with no previous code written on the past. Is there any advantage in using the rtdm skin over the navive one?

Thanks so much.

Carlos Novaes

Em sex 01 jul 2011, às 04:57:27, Gilles Chanteperdrix escreveu:

Quoted 25 lines · Carlos Eduardo de Brito Novaes
Quoted 8 lines

Hello all!
Hope this question fits to the scope of the list.

I got a PCI acquisition board and wish to write a xenomai driver for it. I had did this before with an old ISA board and used memory heaps to exchange data from kernel (configuration and mainly acquisition routines) and the real time processing task.

Quoted 8 lines

Now, I would like to know if I can use only message pipes for this kind of application. I would like to use it so the entire proccess became more "unix like", using memory heaps I think that the internals of the driver are exposed and the any misfuncion can arise due to bad data passed from programmers. Is this right?

Can message pipes provide hard real time timings, about 1K/10K samples per second and about 100 bytes on each sample?

Hi,

you probably should use the RTDM skin to write a driver. So, use the "read" call to get data, or if there is a big volume, use some mmaped aread, using rtdm_mmap_to_user.

Regards.

#3 lore raw

Re: [Xenomai-help] Writing a new driver, Skin differences.

Quoted 6 lines · Carlos Eduardo de Brito Novaes

Hello,

I think I the question on using memory mapped are solved. Now I was wondering and cant find a big difference over the four skins, at least for a new project with no previous code written on the past. Is there any advantage in using the rtdm skin over the navive one?

The RTDM is meant for writing drivers in kernel-space and continuity will be ensured in Xenomai 3.x, whereas the other kernel-space skins will no longer be available in Xenomai 3.x. Writing drivers in kernel-space with either the native or the posix skin is deprecated.

Signature · 1 line
                                                                Gilles.
#4 lore raw

Re: [Xenomai-help] Writing a new driver, Skin differences.

Sorry to get inside in the middle ofconversation... what you mean writing driver in kernel-space is deprecated. Is there any other way to make a driver? I belive a kernel-driver should be the most RT possible no?

Quoted 24 lines · Gilles Chanteperdrix
Quoted 3 lines · Carlos Eduardo de Brito Novaes

Hello,

I think I the question on using memory mapped are solved. Now I was

wondering

Quoted 1 line

and cant find a big difference over the four skins, at least for a new

project

Quoted 1 line

with no previous code written on the past. Is there any advantage in

using the

Quoted 1 line

rtdm skin over the navive one?

The RTDM is meant for writing drivers in kernel-space and continuity will be ensured in Xenomai 3.x, whereas the other kernel-space skins will no longer be available in Xenomai 3.x. Writing drivers in kernel-space with either the native or the posix skin is deprecated.

--
Gilles.

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Signature · 6 lines
Luís Filipe Rossi
Electrical Engineer
Biomechatronics Lab. / Grupo de Sensores Integráveis e Sistemas
Escola Politécnica
Universidade de São Paulo
Cel. +55 (11) 7662-9234
#5 lore raw

Re: [Xenomai-help] Writing a new driver, Skin differences.

Quoted 3 lines · Luis Rossi

Sorry to get inside in the middle ofconversation... what you mean writing driver in kernel-space is deprecated. Is there any other way to make a driver? I belive a kernel-driver should be the most RT possible no?

Read again: writing a driver in kernel-space with the posix or native skin is deprecated. Not with the RTDM skin.

Signature · 1 line
                                                                Gilles.
#6 lore raw

Re: [Xenomai-help] Writing a new driver, Skin differences.

In reply to Gilles Chanteperdrix

Thank you very much, I got it now. I had found out those points on xenomai 3.x and rtdm, so I must be a little more carefull on reading before asking. Sorry for that.

I am starting working on it, at first I think that using rt_dev_read shoud do the work, its easy to set up and there are examples over the net, but I cant find any (online) example on using rtdm_mmap_to_user and also could not figure out the parameters to get it working. Can you point me any other resource or example on using it?

The rtdm skin sens to be well documented but its very poor on examples and detailed description, at least I cant find any resource as informative as those related to the native api.

Thank you,

Carlos Novaes

Em sáb 02 jul 2011, às 17:13:55, Gilles Chanteperdrix escreveu:

Quoted 12 lines · Carlos Eduardo de Brito Novaes
Quoted 6 lines

Hello,

I think I the question on using memory mapped are solved. Now I was wondering and cant find a big difference over the four skins, at least for a new project with no previous code written on the past. Is there any advantage in using the rtdm skin over the navive one?

The RTDM is meant for writing drivers in kernel-space and continuity will be ensured in Xenomai 3.x, whereas the other kernel-space skins will no longer be available in Xenomai 3.x. Writing drivers in kernel-space with either the native or the posix skin is deprecated.