Skip to contentSkip to conversation

Comedi over RTDM

Xenomai-help [email protected] 5 participants 7 messages Jun 25, 2008 – Jun 26, 2008

lore
Share & tools
lore
#0 lore raw

Hi all,

Alex told me that a Comedi port to RTDM exists.

What does this mean ? If i'm able to write a driver for Comedi, this one will work with RTDM and thus with Xenomai ?

I can't see where is the link between both and can't neither find information on that port.

does anybody have recent examples of driver working with Comedi/RTDM ?

many thanks,
Antoine

#1 lore raw

Hi,

Quoted 10 lines

Alex told me that a Comedi port to RTDM exists.

What does this mean ? If i'm able to write a driver for Comedi, this one will work with RTDM and thus with Xenomai ?

I can't see where is the link between both and can't neither find information on that port.

does anybody have recent examples of driver working with Comedi/RTDM ?

Originally, Comedi is a framework for acquisition drivers which can be used in a common Linux system and in some specific real-time context.

This project was initiated by David Schleed. Have a look at the Comedi
website: www.comedi.org. Many documents detail the main ideas.

A little while after the development of RTDM by Jan Kiszka, I started to work on a literal porting of Comedi over RTDM during my free time. I faced no specific issues for the porting of the kernel side of Comedi. But, on the user side, as far as I remember, things were different. I had some difficulties to ensure the real-time context considering the use of common Linux API in the Comedi library (malloc).

So I sent a mail to the Comedi mailing-list to tell that I was interested in writing a reviewed Comedi port for RTDM (here is a link
http://osdir.com/ml/comedi/2006-04/msg00017.html).

This task took a long time as I can only work on it during my spare-time (roughly one or two hours per day; my job is not related with Comedi).

Eventually (at last), the "comedi-rtdm-dev" branch reached a stable state (a few weeks ago). The "comedi-rtdm-dev" consists of a kernel framework and a user-space library. Right now, the critical issue is the recovery of the original Comedi drivers. And, more critically, the integration of new drivers for new devices.

On that last point, I hope some external contributions will help the Comedi4RTDM drivers set to grow as I have no acquisition cards and no way to get some.

By the way, if anyone is interested in Comedi, feel free to help me and / or criticize / improve the code I wrote.

Best regards.

Alexis.

#2 lore raw

A Dijous 26 Juny 2008, Alexis Berlemont va escriure:

Quoted 38 lines

Hi,

Quoted 9 lines

Alex told me that a Comedi port to RTDM exists.

What does this mean ? If i'm able to write a driver for Comedi, this one will work with RTDM and thus with Xenomai ?

I can't see where is the link between both and can't neither find information on that port.

does anybody have recent examples of driver working with Comedi/RTDM ?

Originally, Comedi is a framework for acquisition drivers which can be used in a common Linux system and in some specific real-time context.

This project was initiated by David Schleed. Have a look at the Comedi
website: www.comedi.org. Many documents detail the main ideas.

A little while after the development of RTDM by Jan Kiszka, I started to work on a literal porting of Comedi over RTDM during my free time. I faced no specific issues for the porting of the kernel side of Comedi. But, on the user side, as far as I remember, things were different. I had some difficulties to ensure the real-time context considering the use of common Linux API in the Comedi library (malloc).

So I sent a mail to the Comedi mailing-list to tell that I was interested in writing a reviewed Comedi port for RTDM (here is a link
http://osdir.com/ml/comedi/2006-04/msg00017.html).

This task took a long time as I can only work on it during my spare-time (roughly one or two hours per day; my job is not related with Comedi).

Eventually (at last), the "comedi-rtdm-dev" branch reached a stable state (a few weeks ago). The "comedi-rtdm-dev" consists of a kernel framework and a user-space library. Right now, the critical issue is the recovery of the original Comedi drivers. And, more critically, the integration of new drivers for new devices.

Quoted 6 lines

On that last point, I hope some external contributions will help the Comedi4RTDM drivers set to grow as I have no acquisition cards and no way to get some.

By the way, if anyone is interested in Comedi, feel free to help me and / or criticize / improve the code I wrote.

Alexis,

I would like to help, specially with the jr3 sensor, but I have to admit that you need a level of kernel programing, or comedi or xenomai that I don't have, and it's very frustrate.

I don't understand "exactly" what is comedi-rtdm-dev. You are saying that it's a:

Quoted 1 line

The "comedi-rtdm-dev" consists of a kernel framework

and this is a?

some kernel modules?
some templates to generate a kernel module with xenomai? some code to develop a bridge betwend xenomai and the comedi driver? a wrapper to encapsulate the comedi driver into a xenomai kernel module?
...

Quoted 2 lines

and
a user-space library.

some .h and a .so that let you work with the modules with xenomai and comedi?

Regards,

Leo

Signature · 4 lines
--
Linux User 152692
PGP: 0xF944807E
Catalonia
#3 lore raw

Hi,

Quoted 1 line

I don't understand "exactly" what is comedi-rtdm-dev.

Sorry I should have named it Comedi over RTDM or
Comedi4RTDM, "comedi-rtdm-dev" is just the name of the branch containing the Comedi code (kernel core framework + kernel test drivers + user library + user binary examples) in the Xenomai subversion repository.

Quoted 14 lines

You are saying that
it's

a:

Quoted 1 line

The "comedi-rtdm-dev" consists of a kernel framework

and this is a?

some kernel modules?
some templates to generate a kernel module with xenomai? some code to develop a bridge betwend xenomai and the comedi driver? a wrapper to encapsulate the comedi driver into a xenomai kernel module?
...

Quoted 5 lines
Quoted 2 lines

and
a user-space library.

some .h and a .so that let you work with the modules with xenomai and comedi?

Best regards.

Alexis.

#4 lore raw
In reply to Alexis Berlemont

Hi Alexis,

On Thu, 26 Jun 2008, Alexis Berlemont wrote:
[...]

Quoted 5 lines

Eventually (at last), the "comedi-rtdm-dev" branch reached a stable state (a few weeks ago). The "comedi-rtdm-dev" consists of a kernel framework and a user-space library. Right now, the critical issue is the recovery of the original Comedi drivers. And, more critically, the integration of new drivers for new devices.

Is your port xenomai-version independent yet? Or maybe better, which version do you use to test things?

Quoted 3 lines

On that last point, I hope some external contributions will help the Comedi4RTDM drivers set to grow as I have no acquisition cards and no way to get some.

What effort/steps does it take to port an existing driver into comedi-rtdm-dev?

regards,

Klaas

#5 lore raw
Quoted 4 lines · Klaas Gadeyne

Hi Alexis,

On Thu, 26 Jun 2008, Alexis Berlemont wrote:
[...]

Quoted 8 lines
Quoted 5 lines

Eventually (at last), the "comedi-rtdm-dev" branch reached a stable state (a few weeks ago). The "comedi-rtdm-dev" consists of a kernel framework and a user-space library. Right now, the critical issue is the recovery of the original Comedi drivers. And, more critically, the integration of new drivers for new devices.

Is your port xenomai-version independent yet? Or maybe better, which version do you use to test things?

Sidenote: there is a plan to have Alex's work merged into the upcoming 2.5. This will allow us to complete the jigsaw puzzle on the Xenomai side, paving the way to a comprehensive RTDM-based real-time device driver suite.

Signature · 1 line
Philippe.
#6 lore raw
In reply to Klaas Gadeyne

Hi,

Quoted 3 lines

Is your port xenomai-version independent yet? Or maybe better, which version do you use to test things?

I work with the Xenomai trunk. I already checked with Xenomai 2.4. It should work with Xenomai 2.2 / 2.3 but I have not checked recently.

As Philippe told you, this compatibility point must not be an issue thanks to the integration of Comedi into the next Xenomai releases.

Quoted 6 lines
Quoted 3 lines

On that last point, I hope some external contributions will help the Comedi4RTDM drivers set to grow as I have no acquisition cards and no way to get some.

What effort/steps does it take to port an existing driver into comedi-rtdm-dev?

I have to write a document to explain the little things to update. No deep change must be performed as the main concepts (subdevice, channel, range, instruction, command, etc.) are the same. However, some functions declarations evolved for (I hope) more simplicity. For example, I tried to provide a generic API to transfer data thanks to the asynchronous buffer (via command) with and without DMA (comedi_buf_put(), comedi_buf_get(), etc.).

To give you an idea: adapting the original Comedi driver "jr3_pci" took me 2-3 evenings (it was not longer than 4-5 hours if I remember well). I was not familiar with this driver, I discovered it during the port.

More documentation should be available, I am working on it.

Best regards.

Alexis.