All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] XDDP and inter-driver API.
@ 2012-07-10  2:30 Sunetra Sashi
  2012-07-10  8:40 ` Philippe Gerum
  0 siblings, 1 reply; 15+ messages in thread
From: Sunetra Sashi @ 2012-07-10  2:30 UTC (permalink / raw)
  To: xenomai

Hi,

I am trying to use the XDDP module in order to achieve linux-xenomai domain
cross communication. However, when I install my module which creates a
socket and binds its to the XDDP port, via the *rtdm_socket(AF_RTIPC,
SOCK_DGRAM, IPCPROTO_XDDP)* call, it fails. Also, when I try to open the
device on the linux side, via an *rtdm_open("/dev/rtp0", O_RDWR)*, it also
fails.

Do I need to install any specific xenomai modules for this to work?

Thanks
Shweta

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10  2:30 [Xenomai] XDDP and inter-driver API Sunetra Sashi
@ 2012-07-10  8:40 ` Philippe Gerum
  2012-07-10  9:03   ` Sunetra Sashi
  0 siblings, 1 reply; 15+ messages in thread
From: Philippe Gerum @ 2012-07-10  8:40 UTC (permalink / raw)
  To: Sunetra Sashi; +Cc: xenomai

On 07/10/2012 04:30 AM, Sunetra Sashi wrote:
> Hi,
>
> I am trying to use the XDDP module in order to achieve linux-xenomai domain
> cross communication. However, when I install my module which creates a
> socket and binds its to the XDDP port, via the *rtdm_socket(AF_RTIPC,
> SOCK_DGRAM, IPCPROTO_XDDP)* call, it fails. Also, when I try to open the
> device on the linux side, via an *rtdm_open("/dev/rtp0", O_RDWR)*, it also
> fails.

Please report issues with all details, typically error codes and return 
values. "call fails" is not enough.

Although using rtdm_open() for /dev/rtp0 may work, this pseudo-device 
file should be opened using a plain open(2) call, since we want to open 
the regular linux-side endpoint for the communication.

>
> Do I need to install any specific xenomai modules for this to work?

Obviously, yes. Check IPC drivers in the "Drivers" sub-menu of the 
Xenomai configuration. You need to have CONFIG_XENO_DRIVERS_RTIPC_XDDP 
enabled.

>
> Thanks
> Shweta
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> http://www.xenomai.org/mailman/listinfo/xenomai
>


-- 
Philippe.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10  8:40 ` Philippe Gerum
@ 2012-07-10  9:03   ` Sunetra Sashi
  2012-07-10  9:10     ` Philippe Gerum
  0 siblings, 1 reply; 15+ messages in thread
From: Sunetra Sashi @ 2012-07-10  9:03 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

On Tue, Jul 10, 2012 at 4:40 AM, Philippe Gerum <rpm@xenomai.org> wrote:

> On 07/10/2012 04:30 AM, Sunetra Sashi wrote:
>
>> Hi,
>>
>> I am trying to use the XDDP module in order to achieve linux-xenomai
>> domain
>> cross communication. However, when I install my module which creates a
>> socket and binds its to the XDDP port, via the *rtdm_socket(AF_RTIPC,
>> SOCK_DGRAM, IPCPROTO_XDDP)* call, it fails. Also, when I try to open the
>> device on the linux side, via an *rtdm_open("/dev/rtp0", O_RDWR)*, it also
>> fails.
>>
>
> Please report issues with all details, typically error codes and return
> values. "call fails" is not enough.
>

rtdm_socket call fails with error code 97. The rtdm_open fails with error
code 19.

>
> Although using rtdm_open() for /dev/rtp0 may work, this pseudo-device file
> should be opened using a plain open(2) call, since we want to open the
> regular linux-side endpoint for the communication.


I am making these calls from within the kernel, not from user space. Hence
I ended up using rtdm calls instead

>
>
>> Do I need to install any specific xenomai modules for this to work?
>>
>
> Obviously, yes. Check IPC drivers in the "Drivers" sub-menu of the Xenomai
> configuration. You need to have CONFIG_XENO_DRIVERS_RTIPC_XDDP enabled.
>

I already checked this in the configuration, It is enabled. Should this
also be set to y? CONFIG_XENO_DRIVERS_RTIPC. In my configuration it is set
to m.
Should I see any modules loaded in /proc/xenomai/rtdm/protocol_devices?

>
>
>> Thanks
>> Shweta
>> ______________________________**_________________
>> Xenomai mailing list
>> Xenomai@xenomai.org
>> http://www.xenomai.org/**mailman/listinfo/xenomai<http://www.xenomai.org/mailman/listinfo/xenomai>
>>
>>
>
> --
> Philippe.
>
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10  9:03   ` Sunetra Sashi
@ 2012-07-10  9:10     ` Philippe Gerum
  2012-07-10  9:17       ` Sunetra Sashi
  0 siblings, 1 reply; 15+ messages in thread
From: Philippe Gerum @ 2012-07-10  9:10 UTC (permalink / raw)
  To: Sunetra Sashi; +Cc: xenomai

On 07/10/2012 11:03 AM, Sunetra Sashi wrote:
>
>
> On Tue, Jul 10, 2012 at 4:40 AM, Philippe Gerum <rpm@xenomai.org
> <mailto:rpm@xenomai.org>> wrote:
>
>     On 07/10/2012 04:30 AM, Sunetra Sashi wrote:
>
>         Hi,
>
>         I am trying to use the XDDP module in order to achieve
>         linux-xenomai domain
>         cross communication. However, when I install my module which
>         creates a
>         socket and binds its to the XDDP port, via the
>         *rtdm_socket(AF_RTIPC,
>         SOCK_DGRAM, IPCPROTO_XDDP)* call, it fails. Also, when I try to
>         open the
>         device on the linux side, via an *rtdm_open("/dev/rtp0",
>         O_RDWR)*, it also
>         fails.
>
>
>     Please report issues with all details, typically error codes and
>     return values. "call fails" is not enough.
>
>
> rtdm_socket call fails with error code 97. The rtdm_open fails with
> error code 19.
>
>
>     Although using rtdm_open() for /dev/rtp0 may work, this

Actually, no it won't. What would work is opening a RTDM device via the 
wrapped open() call routed to the Xenomai system, which is the converse way.

>     pseudo-device file should be opened using a plain open(2) call,
>     since we want to open the regular linux-side endpoint for the
>     communication.
>
>
> I am making these calls from within the kernel, not from user space.
> Hence I ended up using rtdm calls instead


/dev/rtp0 is a non-real-time user-space endpoint for the communication, 
between a regular linux application and a real-time component. It does 
not make sense to open it from kernel space.

>
>
>
>         Do I need to install any specific xenomai modules for this to work?
>
>
>     Obviously, yes. Check IPC drivers in the "Drivers" sub-menu of the
>     Xenomai configuration. You need to have
>     CONFIG_XENO_DRIVERS_RTIPC_XDDP enabled.
>
>
> I already checked this in the configuration, It is enabled. Should this
> also be set to y? CONFIG_XENO_DRIVERS_RTIPC. In my configuration it is
> set to m.

Did you load the xeno_rtipc module then?

> Should I see any modules loaded in /proc/xenomai/rtdm/protocol_devices?

Yes.

>
>
>
>         Thanks
>         Shweta
>         _________________________________________________
>         Xenomai mailing list
>         Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>
>         http://www.xenomai.org/__mailman/listinfo/xenomai
>         <http://www.xenomai.org/mailman/listinfo/xenomai>
>
>
>
>     --
>     Philippe.
>
>
>


-- 
Philippe.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10  9:10     ` Philippe Gerum
@ 2012-07-10  9:17       ` Sunetra Sashi
  2012-07-10  9:36         ` Philippe Gerum
  0 siblings, 1 reply; 15+ messages in thread
From: Sunetra Sashi @ 2012-07-10  9:17 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

On Tue, Jul 10, 2012 at 5:10 AM, Philippe Gerum <rpm@xenomai.org> wrote:

> On 07/10/2012 11:03 AM, Sunetra Sashi wrote:
>
>>
>>
>> On Tue, Jul 10, 2012 at 4:40 AM, Philippe Gerum <rpm@xenomai.org
>> <mailto:rpm@xenomai.org>> wrote:
>>
>>     On 07/10/2012 04:30 AM, Sunetra Sashi wrote:
>>
>>         Hi,
>>
>>         I am trying to use the XDDP module in order to achieve
>>         linux-xenomai domain
>>         cross communication. However, when I install my module which
>>         creates a
>>         socket and binds its to the XDDP port, via the
>>         *rtdm_socket(AF_RTIPC,
>>         SOCK_DGRAM, IPCPROTO_XDDP)* call, it fails. Also, when I try to
>>         open the
>>         device on the linux side, via an *rtdm_open("/dev/rtp0",
>>         O_RDWR)*, it also
>>         fails.
>>
>>
>>     Please report issues with all details, typically error codes and
>>     return values. "call fails" is not enough.
>>
>>
>> rtdm_socket call fails with error code 97. The rtdm_open fails with
>> error code 19.
>>
>>
>>     Although using rtdm_open() for /dev/rtp0 may work, this
>>
>
> Actually, no it won't. What would work is opening a RTDM device via the
> wrapped open() call routed to the Xenomai system, which is the converse way.
>
>
>      pseudo-device file should be opened using a plain open(2) call,
>>     since we want to open the regular linux-side endpoint for the
>>     communication.
>>
>>
>> I am making these calls from within the kernel, not from user space.
>> Hence I ended up using rtdm calls instead
>>
>
>
> /dev/rtp0 is a non-real-time user-space endpoint for the communication,
> between a regular linux application and a real-time component. It does not
> make sense to open it from kernel space.


My intent here is to set up something similar to xddp-echo.c  (RT - Non RT
communication) but in kernel space instead. How should I go about creating
the Linux endpoint for XDDP in the kernel?

>
>
>
>>
>>
>>         Do I need to install any specific xenomai modules for this to
>> work?
>>
>>
>>     Obviously, yes. Check IPC drivers in the "Drivers" sub-menu of the
>>     Xenomai configuration. You need to have
>>     CONFIG_XENO_DRIVERS_RTIPC_XDDP enabled.
>>
>>
>> I already checked this in the configuration, It is enabled. Should this
>> also be set to y? CONFIG_XENO_DRIVERS_RTIPC. In my configuration it is
>> set to m.
>>
>
> Did you load the xeno_rtipc module then?


It is not loaded. But I got an error when I did that.
Xenomai: assertion failed at /.../kernel/xenomai/skins/)
Xenomai: RTDM: missing open handler
insmod: error inserting 'xeno_rtipc.ko': -1 Invalid parameters


>
>  Should I see any modules loaded in /proc/xenomai/rtdm/protocol_**devices?
>>
>
> Yes.
>
>
>>
>>
>>         Thanks
>>         Shweta
>>         ______________________________**___________________
>>         Xenomai mailing list
>>         Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>
>>         http://www.xenomai.org/__**mailman/listinfo/xenomai<http://www.xenomai.org/__mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/**mailman/listinfo/xenomai<http://www.xenomai.org/mailman/listinfo/xenomai>
>> >
>>
>>
>>
>>     --
>>     Philippe.
>>
>>
>>
>>
>
> --
> Philippe.
>
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10  9:17       ` Sunetra Sashi
@ 2012-07-10  9:36         ` Philippe Gerum
  2012-07-10 11:23           ` Sunetra Sashi
  0 siblings, 1 reply; 15+ messages in thread
From: Philippe Gerum @ 2012-07-10  9:36 UTC (permalink / raw)
  To: Sunetra Sashi; +Cc: xenomai

On 07/10/2012 11:17 AM, Sunetra Sashi wrote:
>
>
> On Tue, Jul 10, 2012 at 5:10 AM, Philippe Gerum <rpm@xenomai.org
> <mailto:rpm@xenomai.org>> wrote:
>

...

>
>         I am making these calls from within the kernel, not from user space.
>         Hence I ended up using rtdm calls instead
>
>
>
>     /dev/rtp0 is a non-real-time user-space endpoint for the
>     communication, between a regular linux application and a real-time
>     component. It does not make sense to open it from kernel space.
>
>
> My intent here is to set up something similar to xddp-echo.c  (RT - Non
> RT communication) but in kernel space instead. How should I go about
> creating the Linux endpoint for XDDP in the kernel?
>

There is no direct way for that, this device/protocol is not intended 
for this purpose. This is a regular linux application to Xenomai 
real-time communication path, nothing else. Regular linux applications 
live in userland, only.

We don't recommend building applications in kernel space.

>
>
>
>
>
>                  Do I need to install any specific xenomai modules for
>         this to work?
>
>
>              Obviously, yes. Check IPC drivers in the "Drivers" sub-menu
>         of the
>              Xenomai configuration. You need to have
>              CONFIG_XENO_DRIVERS_RTIPC_XDDP enabled.
>
>
>         I already checked this in the configuration, It is enabled.
>         Should this
>         also be set to y? CONFIG_XENO_DRIVERS_RTIPC. In my configuration
>         it is
>         set to m.
>
>
>     Did you load the xeno_rtipc module then?
>
>
> It is not loaded. But I got an error when I did that.
> Xenomai: assertion failed at /.../kernel/xenomai/skins/)
> Xenomai: RTDM: missing open handler

It does not make any sense. This assertion can only trigger for a named 
device, not a protocol device. RTIPC is a protocol device.

- did you change any of the driver code?
- what command did you use to load the module, verbatim?

> insmod: error inserting 'xeno_rtipc.ko': -1 Invalid parameters
>
>
>
>         Should I see any modules loaded in
>         /proc/xenomai/rtdm/protocol___devices?
>
>
>     Yes.
>
>
>
>
>                  Thanks
>                  Shweta
>                  ___________________________________________________
>                  Xenomai mailing list
>         Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>
>         <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>         http://www.xenomai.org/____mailman/listinfo/xenomai
>         <http://www.xenomai.org/__mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/__mailman/listinfo/xenomai
>         <http://www.xenomai.org/mailman/listinfo/xenomai>>
>
>
>
>              --
>              Philippe.
>
>
>
>
>
>     --
>     Philippe.
>
>
>


-- 
Philippe.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10  9:36         ` Philippe Gerum
@ 2012-07-10 11:23           ` Sunetra Sashi
  2012-07-10 15:01             ` Philippe Gerum
  0 siblings, 1 reply; 15+ messages in thread
From: Sunetra Sashi @ 2012-07-10 11:23 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

What is the recommended methodology for kernel space modules to communicate
with each other across the Linux-Xenomai space?

I corrected the rtipc rtdm device as a protocol device (I must have changed
it in error) and I am able to load the xeno_rtipc.ko now. However, the
socket open still fails with the same error code.

Thanks



>
>>         I am making these calls from within the kernel, not from user
>> space.
>>         Hence I ended up using rtdm calls instead
>>
>>
>>
>>     /dev/rtp0 is a non-real-time user-space endpoint for the
>>     communication, between a regular linux application and a real-time
>>     component. It does not make sense to open it from kernel space.
>>
>>
>> My intent here is to set up something similar to xddp-echo.c  (RT - Non
>> RT communication) but in kernel space instead. How should I go about
>> creating the Linux endpoint for XDDP in the kernel?
>>
>>
> There is no direct way for that, this device/protocol is not intended for
> this purpose. This is a regular linux application to Xenomai real-time
> communication path, nothing else. Regular linux applications live in
> userland, only.
>
> We don't recommend building applications in kernel space.
>
>
>
>>
>>
>>
>>
>>                  Do I need to install any specific xenomai modules for
>>         this to work?
>>
>>
>>              Obviously, yes. Check IPC drivers in the "Drivers" sub-menu
>>         of the
>>              Xenomai configuration. You need to have
>>              CONFIG_XENO_DRIVERS_RTIPC_XDDP enabled.
>>
>>
>>         I already checked this in the configuration, It is enabled.
>>         Should this
>>         also be set to y? CONFIG_XENO_DRIVERS_RTIPC. In my configuration
>>         it is
>>         set to m.
>>
>>
>>     Did you load the xeno_rtipc module then?
>>
>>
>> It is not loaded. But I got an error when I did that.
>> Xenomai: assertion failed at /.../kernel/xenomai/skins/)
>> Xenomai: RTDM: missing open handler
>>
>
> It does not make any sense. This assertion can only trigger for a named
> device, not a protocol device. RTIPC is a protocol device.
>
> - did you change any of the driver code?
> - what command did you use to load the module, verbatim?
>
>  insmod: error inserting 'xeno_rtipc.ko': -1 Invalid parameters
>>
>>
>>
>>         Should I see any modules loaded in
>>         /proc/xenomai/rtdm/protocol___**devices?
>>
>>
>>     Yes.
>>
>>
>>
>>
>>                  Thanks
>>                  Shweta
>>                  ______________________________**_____________________
>>
>>                  Xenomai mailing list
>>         Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>
>>         <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>>         http://www.xenomai.org/____**mailman/listinfo/xenomai<http://www.xenomai.org/____mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/__**mailman/listinfo/xenomai<http://www.xenomai.org/__mailman/listinfo/xenomai>
>> >
>>
>>                  <http://www.xenomai.org/__**mailman/listinfo/xenomai<http://www.xenomai.org/__mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/**mailman/listinfo/xenomai<http://www.xenomai.org/mailman/listinfo/xenomai>
>> >>
>>
>>
>>
>>              --
>>              Philippe.
>>
>>
>>
>>
>>
>>     --
>>     Philippe.
>>
>>
>>
>>
>
> --
> Philippe.
>
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10 11:23           ` Sunetra Sashi
@ 2012-07-10 15:01             ` Philippe Gerum
  2012-07-10 15:43               ` Sunetra Sashi
  0 siblings, 1 reply; 15+ messages in thread
From: Philippe Gerum @ 2012-07-10 15:01 UTC (permalink / raw)
  To: Sunetra Sashi; +Cc: xenomai

On 07/10/2012 01:23 PM, Sunetra Sashi wrote:
>
> What is the recommended methodology for kernel space modules to
> communicate with each other across the Linux-Xenomai space?

There is no recommended methodology for this: kernel space should run 
within the linux domain only, or within the Xenomai domain only via the 
inter-driver RTDM interface, or should communicate with user-space only 
via a driver interface. rt <-> nrt within kernel space can be done using 
a low level mechanism, but there is no high level IPC for this.

Again, if your kernel space code is actually an application, spare 
yourself a lot of pain, and move it to userland.

>
> I corrected the rtipc rtdm device as a protocol device (I must have
> changed it in error) and I am able to load the xeno_rtipc.ko now.
> However, the socket open still fails with the same error code.
>
> Thanks
>
>
>                  I am making these calls from within the kernel, not
>         from user space.
>                  Hence I ended up using rtdm calls instead
>
>
>
>              /dev/rtp0 is a non-real-time user-space endpoint for the
>              communication, between a regular linux application and a
>         real-time
>              component. It does not make sense to open it from kernel space.
>
>
>         My intent here is to set up something similar to xddp-echo.c
>           (RT - Non
>         RT communication) but in kernel space instead. How should I go about
>         creating the Linux endpoint for XDDP in the kernel?
>
>
>     There is no direct way for that, this device/protocol is not
>     intended for this purpose. This is a regular linux application to
>     Xenomai real-time communication path, nothing else. Regular linux
>     applications live in userland, only.
>
>     We don't recommend building applications in kernel space.
>
>
>
>
>
>
>
>                           Do I need to install any specific xenomai
>         modules for
>                  this to work?
>
>
>                       Obviously, yes. Check IPC drivers in the "Drivers"
>         sub-menu
>                  of the
>                       Xenomai configuration. You need to have
>                       CONFIG_XENO_DRIVERS_RTIPC_XDDP enabled.
>
>
>                  I already checked this in the configuration, It is enabled.
>                  Should this
>                  also be set to y? CONFIG_XENO_DRIVERS_RTIPC. In my
>         configuration
>                  it is
>                  set to m.
>
>
>              Did you load the xeno_rtipc module then?
>
>
>         It is not loaded. But I got an error when I did that.
>         Xenomai: assertion failed at /.../kernel/xenomai/skins/)
>         Xenomai: RTDM: missing open handler
>
>
>     It does not make any sense. This assertion can only trigger for a
>     named device, not a protocol device. RTIPC is a protocol device.
>
>     - did you change any of the driver code?
>     - what command did you use to load the module, verbatim?
>
>         insmod: error inserting 'xeno_rtipc.ko': -1 Invalid parameters
>
>
>
>                  Should I see any modules loaded in
>                  /proc/xenomai/rtdm/protocol_____devices?
>
>
>              Yes.
>
>
>
>
>                           Thanks
>                           Shweta
>
>           _____________________________________________________
>
>                           Xenomai mailing list
>         Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>
>         <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>                  <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org> <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>>>
>         http://www.xenomai.org/______mailman/listinfo/xenomai
>         <http://www.xenomai.org/____mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/____mailman/listinfo/xenomai
>         <http://www.xenomai.org/__mailman/listinfo/xenomai>>
>
>
>           <http://www.xenomai.org/____mailman/listinfo/xenomai
>         <http://www.xenomai.org/__mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/__mailman/listinfo/xenomai
>         <http://www.xenomai.org/mailman/listinfo/xenomai>>>
>
>
>
>                       --
>                       Philippe.
>
>
>
>
>
>              --
>              Philippe.
>
>
>
>
>
>     --
>     Philippe.
>
>
>


-- 
Philippe.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10 15:01             ` Philippe Gerum
@ 2012-07-10 15:43               ` Sunetra Sashi
  2012-07-10 15:57                 ` Philippe Gerum
  0 siblings, 1 reply; 15+ messages in thread
From: Sunetra Sashi @ 2012-07-10 15:43 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

On Tue, Jul 10, 2012 at 11:01 AM, Philippe Gerum <rpm@xenomai.org> wrote:

> On 07/10/2012 01:23 PM, Sunetra Sashi wrote:
>
>>
>> What is the recommended methodology for kernel space modules to
>> communicate with each other across the Linux-Xenomai space?
>>
>
> There is no recommended methodology for this: kernel space should run
> within the linux domain only, or within the Xenomai domain only via the
> inter-driver RTDM interface, or should communicate with user-space only via
> a driver interface. rt <-> nrt within kernel space can be done using a low
> level mechanism, but there is no high level IPC for this.
>
> Again, if your kernel space code is actually an application, spare
> yourself a lot of pain, and move it to userland.
>

That is interesting. So if I have a linux kernel module, say a network
device driver. And another Xenomai kernel module that needs to run real
time. Since we want to deal with IP packets, we need our linux module to
run in the kernel space. Is it safe to assume that communication between 2
such drivers is not possible in the kernel?



>
>> I corrected the rtipc rtdm device as a protocol device (I must have
>> changed it in error) and I am able to load the xeno_rtipc.ko now.
>> However, the socket open still fails with the same error code.
>>
>> Thanks
>>
>>
>>                  I am making these calls from within the kernel, not
>>         from user space.
>>                  Hence I ended up using rtdm calls instead
>>
>>
>>
>>              /dev/rtp0 is a non-real-time user-space endpoint for the
>>              communication, between a regular linux application and a
>>         real-time
>>              component. It does not make sense to open it from kernel
>> space.
>>
>>
>>         My intent here is to set up something similar to xddp-echo.c
>>           (RT - Non
>>         RT communication) but in kernel space instead. How should I go
>> about
>>         creating the Linux endpoint for XDDP in the kernel?
>>
>>
>>     There is no direct way for that, this device/protocol is not
>>     intended for this purpose. This is a regular linux application to
>>     Xenomai real-time communication path, nothing else. Regular linux
>>     applications live in userland, only.
>>
>>     We don't recommend building applications in kernel space.
>>
>>
>>
>>
>>
>>
>>
>>                           Do I need to install any specific xenomai
>>         modules for
>>                  this to work?
>>
>>
>>                       Obviously, yes. Check IPC drivers in the "Drivers"
>>         sub-menu
>>                  of the
>>                       Xenomai configuration. You need to have
>>                       CONFIG_XENO_DRIVERS_RTIPC_XDDP enabled.
>>
>>
>>                  I already checked this in the configuration, It is
>> enabled.
>>                  Should this
>>                  also be set to y? CONFIG_XENO_DRIVERS_RTIPC. In my
>>         configuration
>>                  it is
>>                  set to m.
>>
>>
>>              Did you load the xeno_rtipc module then?
>>
>>
>>         It is not loaded. But I got an error when I did that.
>>         Xenomai: assertion failed at /.../kernel/xenomai/skins/)
>>         Xenomai: RTDM: missing open handler
>>
>>
>>     It does not make any sense. This assertion can only trigger for a
>>     named device, not a protocol device. RTIPC is a protocol device.
>>
>>     - did you change any of the driver code?
>>     - what command did you use to load the module, verbatim?
>>
>>         insmod: error inserting 'xeno_rtipc.ko': -1 Invalid parameters
>>
>>
>>
>>                  Should I see any modules loaded in
>>                  /proc/xenomai/rtdm/protocol___**__devices?
>>
>>
>>              Yes.
>>
>>
>>
>>
>>                           Thanks
>>                           Shweta
>>
>>           ______________________________**_______________________
>>
>>
>>                           Xenomai mailing list
>>         Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>
>>         <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>>                  <mailto:Xenomai@xenomai.org
>>         <mailto:Xenomai@xenomai.org> <mailto:Xenomai@xenomai.org
>>         <mailto:Xenomai@xenomai.org>>>
>>         http://www.xenomai.org/______**mailman/listinfo/xenomai<http://www.xenomai.org/______mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/____**mailman/listinfo/xenomai<http://www.xenomai.org/____mailman/listinfo/xenomai>
>> >
>>
>>                  <http://www.xenomai.org/____**mailman/listinfo/xenomai<http://www.xenomai.org/____mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/__**mailman/listinfo/xenomai<http://www.xenomai.org/__mailman/listinfo/xenomai>
>> >>
>>
>>
>>           <http://www.xenomai.org/____**mailman/listinfo/xenomai<http://www.xenomai.org/____mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/__**mailman/listinfo/xenomai<http://www.xenomai.org/__mailman/listinfo/xenomai>
>> >
>>                  <http://www.xenomai.org/__**mailman/listinfo/xenomai<http://www.xenomai.org/__mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/**mailman/listinfo/xenomai<http://www.xenomai.org/mailman/listinfo/xenomai>
>> >>>
>>
>>
>>
>>                       --
>>                       Philippe.
>>
>>
>>
>>
>>
>>              --
>>              Philippe.
>>
>>
>>
>>
>>
>>     --
>>     Philippe.
>>
>>
>>
>>
>
> --
> Philippe.
>
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10 15:43               ` Sunetra Sashi
@ 2012-07-10 15:57                 ` Philippe Gerum
  2012-07-10 16:15                   ` Sunetra Sashi
  0 siblings, 1 reply; 15+ messages in thread
From: Philippe Gerum @ 2012-07-10 15:57 UTC (permalink / raw)
  To: Sunetra Sashi; +Cc: xenomai

On 07/10/2012 05:43 PM, Sunetra Sashi wrote:
>
>
> On Tue, Jul 10, 2012 at 11:01 AM, Philippe Gerum <rpm@xenomai.org
> <mailto:rpm@xenomai.org>> wrote:
>
>     On 07/10/2012 01:23 PM, Sunetra Sashi wrote:
>
>
>         What is the recommended methodology for kernel space modules to
>         communicate with each other across the Linux-Xenomai space?
>
>
>     There is no recommended methodology for this: kernel space should
>     run within the linux domain only, or within the Xenomai domain only
>     via the inter-driver RTDM interface, or should communicate with
>     user-space only via a driver interface. rt <-> nrt within kernel
>     space can be done using a low level mechanism, but there is no high
>     level IPC for this.
>
>     Again, if your kernel space code is actually an application, spare
>     yourself a lot of pain, and move it to userland.
>
>
> That is interesting. So if I have a linux kernel module, say a network
> device driver. And another Xenomai kernel module that needs to run real
> time. Since we want to deal with IP packets, we need our linux module to
> run in the kernel space. Is it safe to assume that communication between
> 2 such drivers is not possible in the kernel?
>
>

Where did you read the word "impossible" in any of my mails? I've been 
telling you two things:

- the kind of interface you mention cannot be done using off-the-shelf 
Xenomai IPCs. It could be done with a low level interface though, hint: 
linux netdev interfacing to Xenomai APCs.

- if your linux module actually runs an application, then you may want 
to consider moving it to userland, where it belongs. We strongly 
discourage implementing application code in kernel space.

I don't know what you actually want to do, but it looks like some port 
of legacy code from say, VxWorks/pSOS/whatever to linux. If so, then you 
should reconsider your target software design, it looks wrong. There are 
better ways to do this, less error prone, more efficient and 
maintainable, provided you stop insisting on running application bits in 
kernel space.

>
>
>         I corrected the rtipc rtdm device as a protocol device (I must have
>         changed it in error) and I am able to load the xeno_rtipc.ko now.
>         However, the socket open still fails with the same error code.
>
>         Thanks
>
>
>                           I am making these calls from within the
>         kernel, not
>                  from user space.
>                           Hence I ended up using rtdm calls instead
>
>
>
>                       /dev/rtp0 is a non-real-time user-space endpoint
>         for the
>                       communication, between a regular linux application
>         and a
>                  real-time
>                       component. It does not make sense to open it from
>         kernel space.
>
>
>                  My intent here is to set up something similar to
>         xddp-echo.c
>                    (RT - Non
>                  RT communication) but in kernel space instead. How
>         should I go about
>                  creating the Linux endpoint for XDDP in the kernel?
>
>
>              There is no direct way for that, this device/protocol is not
>              intended for this purpose. This is a regular linux
>         application to
>              Xenomai real-time communication path, nothing else. Regular
>         linux
>              applications live in userland, only.
>
>              We don't recommend building applications in kernel space.
>
>
>
>
>
>
>
>                                    Do I need to install any specific xenomai
>                  modules for
>                           this to work?
>
>
>                                Obviously, yes. Check IPC drivers in the
>         "Drivers"
>                  sub-menu
>                           of the
>                                Xenomai configuration. You need to have
>                                CONFIG_XENO_DRIVERS_RTIPC_XDDP enabled.
>
>
>                           I already checked this in the configuration,
>         It is enabled.
>                           Should this
>                           also be set to y? CONFIG_XENO_DRIVERS_RTIPC. In my
>                  configuration
>                           it is
>                           set to m.
>
>
>                       Did you load the xeno_rtipc module then?
>
>
>                  It is not loaded. But I got an error when I did that.
>                  Xenomai: assertion failed at /.../kernel/xenomai/skins/)
>                  Xenomai: RTDM: missing open handler
>
>
>              It does not make any sense. This assertion can only trigger
>         for a
>              named device, not a protocol device. RTIPC is a protocol
>         device.
>
>              - did you change any of the driver code?
>              - what command did you use to load the module, verbatim?
>
>                  insmod: error inserting 'xeno_rtipc.ko': -1 Invalid
>         parameters
>
>
>
>                           Should I see any modules loaded in
>                           /proc/xenomai/rtdm/protocol_______devices?
>
>
>                       Yes.
>
>
>
>
>                                    Thanks
>                                    Shweta
>
>                    _______________________________________________________
>
>
>                                    Xenomai mailing list
>         Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>
>         <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>                  <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org> <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>>>
>                           <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>
>                  <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>> <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>
>                  <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>>>
>         http://www.xenomai.org/________mailman/listinfo/xenomai
>         <http://www.xenomai.org/______mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/______mailman/listinfo/xenomai
>         <http://www.xenomai.org/____mailman/listinfo/xenomai>>
>
>
>           <http://www.xenomai.org/______mailman/listinfo/xenomai
>         <http://www.xenomai.org/____mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/____mailman/listinfo/xenomai
>         <http://www.xenomai.org/__mailman/listinfo/xenomai>>>
>
>
>
>         <http://www.xenomai.org/______mailman/listinfo/xenomai
>         <http://www.xenomai.org/____mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/____mailman/listinfo/xenomai
>         <http://www.xenomai.org/__mailman/listinfo/xenomai>>
>
>           <http://www.xenomai.org/____mailman/listinfo/xenomai
>         <http://www.xenomai.org/__mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/__mailman/listinfo/xenomai
>         <http://www.xenomai.org/mailman/listinfo/xenomai>>>>
>
>
>
>                                --
>                                Philippe.
>
>
>
>
>
>                       --
>                       Philippe.
>
>
>
>
>
>              --
>              Philippe.
>
>
>
>
>
>     --
>     Philippe.
>
>
>


-- 
Philippe.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10 15:57                 ` Philippe Gerum
@ 2012-07-10 16:15                   ` Sunetra Sashi
  2012-07-10 16:24                     ` Lennart Sorensen
  2012-07-10 17:09                     ` Philippe Gerum
  0 siblings, 2 replies; 15+ messages in thread
From: Sunetra Sashi @ 2012-07-10 16:15 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

Thanks for clarifying. I should have said ¨not possible using Xenomai
IPCs¨. Sorry about that.

I am not trying to port legacy code. I am instead trying to establish a
communication pathway from voice applications in user land to some real
time xenomai code running within the kernel via a linux driver KM running
native linux. In our instance, it is necessary that the code executes in
the kernel space.

On a related note, if I create a simple xenomai kernel module running real
time code and signal events to it from linux kernel space (via the rt_event
API) and communicate information back via interrupts (assuming we manage
memory via shared buffers), would that considered to be a true
Linux-Xenomai switch?






On Tue, Jul 10, 2012 at 11:57 AM, Philippe Gerum <rpm@xenomai.org> wrote:

> On 07/10/2012 05:43 PM, Sunetra Sashi wrote:
>
>>
>>
>> On Tue, Jul 10, 2012 at 11:01 AM, Philippe Gerum <rpm@xenomai.org
>> <mailto:rpm@xenomai.org>> wrote:
>>
>>     On 07/10/2012 01:23 PM, Sunetra Sashi wrote:
>>
>>
>>         What is the recommended methodology for kernel space modules to
>>         communicate with each other across the Linux-Xenomai space?
>>
>>
>>     There is no recommended methodology for this: kernel space should
>>     run within the linux domain only, or within the Xenomai domain only
>>     via the inter-driver RTDM interface, or should communicate with
>>     user-space only via a driver interface. rt <-> nrt within kernel
>>     space can be done using a low level mechanism, but there is no high
>>     level IPC for this.
>>
>>     Again, if your kernel space code is actually an application, spare
>>     yourself a lot of pain, and move it to userland.
>>
>>
>> That is interesting. So if I have a linux kernel module, say a network
>> device driver. And another Xenomai kernel module that needs to run real
>> time. Since we want to deal with IP packets, we need our linux module to
>> run in the kernel space. Is it safe to assume that communication between
>> 2 such drivers is not possible in the kernel?
>>
>>
>>
> Where did you read the word "impossible" in any of my mails? I've been
> telling you two things:
>
> - the kind of interface you mention cannot be done using off-the-shelf
> Xenomai IPCs. It could be done with a low level interface though, hint:
> linux netdev interfacing to Xenomai APCs.
>
> - if your linux module actually runs an application, then you may want to
> consider moving it to userland, where it belongs. We strongly discourage
> implementing application code in kernel space.
>
> I don't know what you actually want to do, but it looks like some port of
> legacy code from say, VxWorks/pSOS/whatever to linux. If so, then you
> should reconsider your target software design, it looks wrong. There are
> better ways to do this, less error prone, more efficient and maintainable,
> provided you stop insisting on running application bits in kernel space.
>
>
>>
>>         I corrected the rtipc rtdm device as a protocol device (I must
>> have
>>         changed it in error) and I am able to load the xeno_rtipc.ko now.
>>         However, the socket open still fails with the same error code.
>>
>>         Thanks
>>
>>
>>                           I am making these calls from within the
>>         kernel, not
>>                  from user space.
>>                           Hence I ended up using rtdm calls instead
>>
>>
>>
>>                       /dev/rtp0 is a non-real-time user-space endpoint
>>         for the
>>                       communication, between a regular linux application
>>         and a
>>                  real-time
>>                       component. It does not make sense to open it from
>>         kernel space.
>>
>>
>>                  My intent here is to set up something similar to
>>         xddp-echo.c
>>                    (RT - Non
>>                  RT communication) but in kernel space instead. How
>>         should I go about
>>                  creating the Linux endpoint for XDDP in the kernel?
>>
>>
>>              There is no direct way for that, this device/protocol is not
>>              intended for this purpose. This is a regular linux
>>         application to
>>              Xenomai real-time communication path, nothing else. Regular
>>         linux
>>              applications live in userland, only.
>>
>>              We don't recommend building applications in kernel space.
>>
>>
>>
>>
>>
>>
>>
>>                                    Do I need to install any specific
>> xenomai
>>                  modules for
>>                           this to work?
>>
>>
>>                                Obviously, yes. Check IPC drivers in the
>>         "Drivers"
>>                  sub-menu
>>                           of the
>>                                Xenomai configuration. You need to have
>>                                CONFIG_XENO_DRIVERS_RTIPC_XDDP enabled.
>>
>>
>>                           I already checked this in the configuration,
>>         It is enabled.
>>                           Should this
>>                           also be set to y? CONFIG_XENO_DRIVERS_RTIPC. In
>> my
>>                  configuration
>>                           it is
>>                           set to m.
>>
>>
>>                       Did you load the xeno_rtipc module then?
>>
>>
>>                  It is not loaded. But I got an error when I did that.
>>                  Xenomai: assertion failed at /.../kernel/xenomai/skins/)
>>                  Xenomai: RTDM: missing open handler
>>
>>
>>              It does not make any sense. This assertion can only trigger
>>         for a
>>              named device, not a protocol device. RTIPC is a protocol
>>         device.
>>
>>              - did you change any of the driver code?
>>              - what command did you use to load the module, verbatim?
>>
>>                  insmod: error inserting 'xeno_rtipc.ko': -1 Invalid
>>         parameters
>>
>>
>>
>>                           Should I see any modules loaded in
>>                           /proc/xenomai/rtdm/protocol___**____devices?
>>
>>
>>                       Yes.
>>
>>
>>
>>
>>                                    Thanks
>>                                    Shweta
>>
>>                    ______________________________**
>> _________________________
>>
>>
>>
>>                                    Xenomai mailing list
>>         Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>
>>         <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>>                  <mailto:Xenomai@xenomai.org
>>         <mailto:Xenomai@xenomai.org> <mailto:Xenomai@xenomai.org
>>         <mailto:Xenomai@xenomai.org>>>
>>                           <mailto:Xenomai@xenomai.org
>>         <mailto:Xenomai@xenomai.org>
>>                  <mailto:Xenomai@xenomai.org
>>         <mailto:Xenomai@xenomai.org>> <mailto:Xenomai@xenomai.org
>>         <mailto:Xenomai@xenomai.org>
>>                  <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org
>> >>>**>
>>         http://www.xenomai.org/_______**_mailman/listinfo/xenomai<http://www.xenomai.org/________mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/______**mailman/listinfo/xenomai<http://www.xenomai.org/______mailman/listinfo/xenomai>
>> >
>>
>>                  <http://www.xenomai.org/______**mailman/listinfo/xenomai<http://www.xenomai.org/______mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/____**mailman/listinfo/xenomai<http://www.xenomai.org/____mailman/listinfo/xenomai>
>> >>
>>
>>
>>           <http://www.xenomai.org/______**mailman/listinfo/xenomai<http://www.xenomai.org/______mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/____**mailman/listinfo/xenomai<http://www.xenomai.org/____mailman/listinfo/xenomai>
>> >
>>                  <http://www.xenomai.org/____**mailman/listinfo/xenomai<http://www.xenomai.org/____mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/__**mailman/listinfo/xenomai<http://www.xenomai.org/__mailman/listinfo/xenomai>
>> >>>
>>
>>
>>
>>         <http://www.xenomai.org/______**mailman/listinfo/xenomai<http://www.xenomai.org/______mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/____**mailman/listinfo/xenomai<http://www.xenomai.org/____mailman/listinfo/xenomai>
>> >
>>                  <http://www.xenomai.org/____**mailman/listinfo/xenomai<http://www.xenomai.org/____mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/__**mailman/listinfo/xenomai<http://www.xenomai.org/__mailman/listinfo/xenomai>
>> >>
>>
>>           <http://www.xenomai.org/____**mailman/listinfo/xenomai<http://www.xenomai.org/____mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/__**mailman/listinfo/xenomai<http://www.xenomai.org/__mailman/listinfo/xenomai>
>> >
>>                  <http://www.xenomai.org/__**mailman/listinfo/xenomai<http://www.xenomai.org/__mailman/listinfo/xenomai>
>>         <http://www.xenomai.org/**mailman/listinfo/xenomai<http://www.xenomai.org/mailman/listinfo/xenomai>
>> >>>>
>>
>>
>>
>>                                --
>>                                Philippe.
>>
>>
>>
>>
>>
>>                       --
>>                       Philippe.
>>
>>
>>
>>
>>
>>              --
>>              Philippe.
>>
>>
>>
>>
>>
>>     --
>>     Philippe.
>>
>>
>>
>>
>
> --
> Philippe.
>
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10 16:15                   ` Sunetra Sashi
@ 2012-07-10 16:24                     ` Lennart Sorensen
  2012-07-10 17:00                       ` Philippe Gerum
  2012-07-10 17:09                     ` Philippe Gerum
  1 sibling, 1 reply; 15+ messages in thread
From: Lennart Sorensen @ 2012-07-10 16:24 UTC (permalink / raw)
  To: Sunetra Sashi; +Cc: xenomai

On Tue, Jul 10, 2012 at 12:15:24PM -0400, Sunetra Sashi wrote:
> Thanks for clarifying. I should have said ¨not possible using Xenomai
> IPCs¨. Sorry about that.
> 
> I am not trying to port legacy code. I am instead trying to establish a
> communication pathway from voice applications in user land to some real
> time xenomai code running within the kernel via a linux driver KM running
> native linux. In our instance, it is necessary that the code executes in
> the kernel space.

Nothing is ever necesary.  Sometimes it may be easier.

> On a related note, if I create a simple xenomai kernel module running real
> time code and signal events to it from linux kernel space (via the rt_event
> API) and communicate information back via interrupts (assuming we manage
> memory via shared buffers), would that considered to be a true
> Linux-Xenomai switch?

My understanding was that xenomai 3.x won't even allow kernel mode
realtime anymore, only userspace, so unless you have no intension of
ever going to future versions, you probably don't want to design your
code that way.

I must admit I haven't checked the details of that to see how device
drivers for xenomai are supposed to be handled in 3.x.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10 16:24                     ` Lennart Sorensen
@ 2012-07-10 17:00                       ` Philippe Gerum
  0 siblings, 0 replies; 15+ messages in thread
From: Philippe Gerum @ 2012-07-10 17:00 UTC (permalink / raw)
  To: Lennart Sorensen; +Cc: xenomai

On 07/10/2012 06:24 PM, Lennart Sorensen wrote:
> On Tue, Jul 10, 2012 at 12:15:24PM -0400, Sunetra Sashi wrote:
>> Thanks for clarifying. I should have said ¨not possible using Xenomai
>> IPCs¨. Sorry about that.
>>
>> I am not trying to port legacy code. I am instead trying to establish a
>> communication pathway from voice applications in user land to some real
>> time xenomai code running within the kernel via a linux driver KM running
>> native linux. In our instance, it is necessary that the code executes in
>> the kernel space.
>
> Nothing is ever necesary.  Sometimes it may be easier.
>
>> On a related note, if I create a simple xenomai kernel module running real
>> time code and signal events to it from linux kernel space (via the rt_event
>> API) and communicate information back via interrupts (assuming we manage
>> memory via shared buffers), would that considered to be a true
>> Linux-Xenomai switch?
>
> My understanding was that xenomai 3.x won't even allow kernel mode
> realtime anymore, only userspace, so unless you have no intension of
> ever going to future versions, you probably don't want to design your
> code that way.
>
> I must admit I haven't checked the details of that to see how device
> drivers for xenomai are supposed to be handled in 3.x.
>

Xenomai will allow real-time mode in kernel space, but only over RTDM tasks.

-- 
Philippe.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10 16:15                   ` Sunetra Sashi
  2012-07-10 16:24                     ` Lennart Sorensen
@ 2012-07-10 17:09                     ` Philippe Gerum
  2012-07-10 17:20                       ` Snmgmt
  1 sibling, 1 reply; 15+ messages in thread
From: Philippe Gerum @ 2012-07-10 17:09 UTC (permalink / raw)
  To: Sunetra Sashi; +Cc: xenomai

On 07/10/2012 06:15 PM, Sunetra Sashi wrote:
>
> Thanks for clarifying. I should have said ¨not possible using Xenomai
> IPCs¨. Sorry about that.
>
> I am not trying to port legacy code. I am instead trying to establish a
> communication pathway from voice applications in user land to some real
> time xenomai code running within the kernel via a linux driver KM
> running native linux. In our instance, it is necessary that the code
> executes in the kernel space.

I have a very simple question: would the real-time code implement a driver?

>
> On a related note, if I create a simple xenomai kernel module running
> real time code and signal events to it from linux kernel space (via the
> rt_event API) and communicate information back via interrupts (assuming
> we manage memory via shared buffers), would that considered to be a true
> Linux-Xenomai switch?
>
>
>
>
>
>
> On Tue, Jul 10, 2012 at 11:57 AM, Philippe Gerum <rpm@xenomai.org
> <mailto:rpm@xenomai.org>> wrote:
>
>     On 07/10/2012 05:43 PM, Sunetra Sashi wrote:
>
>
>
>         On Tue, Jul 10, 2012 at 11:01 AM, Philippe Gerum
>         <rpm@xenomai.org <mailto:rpm@xenomai.org>
>         <mailto:rpm@xenomai.org <mailto:rpm@xenomai.org>>> wrote:
>
>              On 07/10/2012 01:23 PM, Sunetra Sashi wrote:
>
>
>                  What is the recommended methodology for kernel space
>         modules to
>                  communicate with each other across the Linux-Xenomai space?
>
>
>              There is no recommended methodology for this: kernel space
>         should
>              run within the linux domain only, or within the Xenomai
>         domain only
>              via the inter-driver RTDM interface, or should communicate with
>              user-space only via a driver interface. rt <-> nrt within
>         kernel
>              space can be done using a low level mechanism, but there is
>         no high
>              level IPC for this.
>
>              Again, if your kernel space code is actually an
>         application, spare
>              yourself a lot of pain, and move it to userland.
>
>
>         That is interesting. So if I have a linux kernel module, say a
>         network
>         device driver. And another Xenomai kernel module that needs to
>         run real
>         time. Since we want to deal with IP packets, we need our linux
>         module to
>         run in the kernel space. Is it safe to assume that communication
>         between
>         2 such drivers is not possible in the kernel?
>
>
>
>     Where did you read the word "impossible" in any of my mails? I've
>     been telling you two things:
>
>     - the kind of interface you mention cannot be done using
>     off-the-shelf Xenomai IPCs. It could be done with a low level
>     interface though, hint: linux netdev interfacing to Xenomai APCs.
>
>     - if your linux module actually runs an application, then you may
>     want to consider moving it to userland, where it belongs. We
>     strongly discourage implementing application code in kernel space.
>
>     I don't know what you actually want to do, but it looks like some
>     port of legacy code from say, VxWorks/pSOS/whatever to linux. If so,
>     then you should reconsider your target software design, it looks
>     wrong. There are better ways to do this, less error prone, more
>     efficient and maintainable, provided you stop insisting on running
>     application bits in kernel space.
>
>
>
>                  I corrected the rtipc rtdm device as a protocol device
>         (I must have
>                  changed it in error) and I am able to load the
>         xeno_rtipc.ko now.
>                  However, the socket open still fails with the same
>         error code.
>
>                  Thanks
>
>
>                                    I am making these calls from within the
>                  kernel, not
>                           from user space.
>                                    Hence I ended up using rtdm calls instead
>
>
>
>                                /dev/rtp0 is a non-real-time user-space
>         endpoint
>                  for the
>                                communication, between a regular linux
>         application
>                  and a
>                           real-time
>                                component. It does not make sense to open
>         it from
>                  kernel space.
>
>
>                           My intent here is to set up something similar to
>                  xddp-echo.c
>                             (RT - Non
>                           RT communication) but in kernel space instead. How
>                  should I go about
>                           creating the Linux endpoint for XDDP in the
>         kernel?
>
>
>                       There is no direct way for that, this
>         device/protocol is not
>                       intended for this purpose. This is a regular linux
>                  application to
>                       Xenomai real-time communication path, nothing
>         else. Regular
>                  linux
>                       applications live in userland, only.
>
>                       We don't recommend building applications in kernel
>         space.
>
>
>
>
>
>
>
>                                             Do I need to install any
>         specific xenomai
>                           modules for
>                                    this to work?
>
>
>                                         Obviously, yes. Check IPC
>         drivers in the
>                  "Drivers"
>                           sub-menu
>                                    of the
>                                         Xenomai configuration. You need
>         to have
>                                         CONFIG_XENO_DRIVERS_RTIPC_XDDP
>         enabled.
>
>
>                                    I already checked this in the
>         configuration,
>                  It is enabled.
>                                    Should this
>                                    also be set to y?
>         CONFIG_XENO_DRIVERS_RTIPC. In my
>                           configuration
>                                    it is
>                                    set to m.
>
>
>                                Did you load the xeno_rtipc module then?
>
>
>                           It is not loaded. But I got an error when I
>         did that.
>                           Xenomai: assertion failed at
>         /.../kernel/xenomai/skins/)
>                           Xenomai: RTDM: missing open handler
>
>
>                       It does not make any sense. This assertion can
>         only trigger
>                  for a
>                       named device, not a protocol device. RTIPC is a
>         protocol
>                  device.
>
>                       - did you change any of the driver code?
>                       - what command did you use to load the module,
>         verbatim?
>
>                           insmod: error inserting 'xeno_rtipc.ko': -1
>         Invalid
>                  parameters
>
>
>
>                                    Should I see any modules loaded in
>
>         /proc/xenomai/rtdm/protocol_________devices?
>
>
>                                Yes.
>
>
>
>
>                                             Thanks
>                                             Shweta
>
>
>           _________________________________________________________
>
>
>
>                                             Xenomai mailing list
>         Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>
>         <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>                  <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org> <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>>>
>                           <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>
>                  <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>> <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>
>                  <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>>>
>                                    <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>
>                  <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>                           <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>
>                  <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>>> <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>
>                  <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>                           <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org> <mailto:Xenomai@xenomai.org
>         <mailto:Xenomai@xenomai.org>>>>__>
>         http://www.xenomai.org/__________mailman/listinfo/xenomai
>         <http://www.xenomai.org/________mailman/listinfo/xenomai>
>
>         <http://www.xenomai.org/________mailman/listinfo/xenomai
>         <http://www.xenomai.org/______mailman/listinfo/xenomai>>
>
>
>           <http://www.xenomai.org/________mailman/listinfo/xenomai
>         <http://www.xenomai.org/______mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/______mailman/listinfo/xenomai
>         <http://www.xenomai.org/____mailman/listinfo/xenomai>>>
>
>
>
>         <http://www.xenomai.org/________mailman/listinfo/xenomai
>         <http://www.xenomai.org/______mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/______mailman/listinfo/xenomai
>         <http://www.xenomai.org/____mailman/listinfo/xenomai>>
>
>           <http://www.xenomai.org/______mailman/listinfo/xenomai
>         <http://www.xenomai.org/____mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/____mailman/listinfo/xenomai
>         <http://www.xenomai.org/__mailman/listinfo/xenomai>>>>
>
>
>
>
>         <http://www.xenomai.org/________mailman/listinfo/xenomai
>         <http://www.xenomai.org/______mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/______mailman/listinfo/xenomai
>         <http://www.xenomai.org/____mailman/listinfo/xenomai>>
>
>           <http://www.xenomai.org/______mailman/listinfo/xenomai
>         <http://www.xenomai.org/____mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/____mailman/listinfo/xenomai
>         <http://www.xenomai.org/__mailman/listinfo/xenomai>>>
>
>
>         <http://www.xenomai.org/______mailman/listinfo/xenomai
>         <http://www.xenomai.org/____mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/____mailman/listinfo/xenomai
>         <http://www.xenomai.org/__mailman/listinfo/xenomai>>
>
>           <http://www.xenomai.org/____mailman/listinfo/xenomai
>         <http://www.xenomai.org/__mailman/listinfo/xenomai>
>                  <http://www.xenomai.org/__mailman/listinfo/xenomai
>         <http://www.xenomai.org/mailman/listinfo/xenomai>>>>>
>
>
>
>                                         --
>                                         Philippe.
>
>
>
>
>
>                                --
>                                Philippe.
>
>
>
>
>
>                       --
>                       Philippe.
>
>
>
>
>
>              --
>              Philippe.
>
>
>
>
>
>     --
>     Philippe.
>
>
>


-- 
Philippe.




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [Xenomai] XDDP and inter-driver API.
  2012-07-10 17:09                     ` Philippe Gerum
@ 2012-07-10 17:20                       ` Snmgmt
  0 siblings, 0 replies; 15+ messages in thread
From: Snmgmt @ 2012-07-10 17:20 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai




On Jul 10, 2012, at 1:09 PM, Philippe Gerum <rpm@xenomai.org> wrote:

> On 07/10/2012 06:15 PM, Sunetra Sashi wrote:
>> 
>> Thanks for clarifying. I should have said ¨not possible using Xenomai
>> IPCs¨. Sorry about that.
>> 
>> I am not trying to port legacy code. I am instead trying to establish a
>> communication pathway from voice applications in user land to some real
>> time xenomai code running within the kernel via a linux driver KM
>> running native linux. In our instance, it is necessary that the code
>> executes in the kernel space.
> 
> I have a very simple question: would the real-time code implement a driver?
> 
No, it is a simple xenomai task doing some preliminary things before data hits the h/w.
>> 
>> On a related note, if I create a simple xenomai kernel module running
>> real time code and signal events to it from linux kernel space (via the
>> rt_event API) and communicate information back via interrupts (assuming
>> we manage memory via shared buffers), would that considered to be a true
>> Linux-Xenomai switch?
>> 
>> 
>> 
>> 
>> 
>> 
>> On Tue, Jul 10, 2012 at 11:57 AM, Philippe Gerum <rpm@xenomai.org
>> <mailto:rpm@xenomai.org>> wrote:
>> 
>>    On 07/10/2012 05:43 PM, Sunetra Sashi wrote:
>> 
>> 
>> 
>>        On Tue, Jul 10, 2012 at 11:01 AM, Philippe Gerum
>>        <rpm@xenomai.org <mailto:rpm@xenomai.org>
>>        <mailto:rpm@xenomai.org <mailto:rpm@xenomai.org>>> wrote:
>> 
>>             On 07/10/2012 01:23 PM, Sunetra Sashi wrote:
>> 
>> 
>>                 What is the recommended methodology for kernel space
>>        modules to
>>                 communicate with each other across the Linux-Xenomai space?
>> 
>> 
>>             There is no recommended methodology for this: kernel space
>>        should
>>             run within the linux domain only, or within the Xenomai
>>        domain only
>>             via the inter-driver RTDM interface, or should communicate with
>>             user-space only via a driver interface. rt <-> nrt within
>>        kernel
>>             space can be done using a low level mechanism, but there is
>>        no high
>>             level IPC for this.
>> 
>>             Again, if your kernel space code is actually an
>>        application, spare
>>             yourself a lot of pain, and move it to userland.
>> 
>> 
>>        That is interesting. So if I have a linux kernel module, say a
>>        network
>>        device driver. And another Xenomai kernel module that needs to
>>        run real
>>        time. Since we want to deal with IP packets, we need our linux
>>        module to
>>        run in the kernel space. Is it safe to assume that communication
>>        between
>>        2 such drivers is not possible in the kernel?
>> 
>> 
>> 
>>    Where did you read the word "impossible" in any of my mails? I've
>>    been telling you two things:
>> 
>>    - the kind of interface you mention cannot be done using
>>    off-the-shelf Xenomai IPCs. It could be done with a low level
>>    interface though, hint: linux netdev interfacing to Xenomai APCs.
>> 
>>    - if your linux module actually runs an application, then you may
>>    want to consider moving it to userland, where it belongs. We
>>    strongly discourage implementing application code in kernel space.
>> 
>>    I don't know what you actually want to do, but it looks like some
>>    port of legacy code from say, VxWorks/pSOS/whatever to linux. If so,
>>    then you should reconsider your target software design, it looks
>>    wrong. There are better ways to do this, less error prone, more
>>    efficient and maintainable, provided you stop insisting on running
>>    application bits in kernel space.
>> 
>> 
>> 
>>                 I corrected the rtipc rtdm device as a protocol device
>>        (I must have
>>                 changed it in error) and I am able to load the
>>        xeno_rtipc.ko now.
>>                 However, the socket open still fails with the same
>>        error code.
>> 
>>                 Thanks
>> 
>> 
>>                                   I am making these calls from within the
>>                 kernel, not
>>                          from user space.
>>                                   Hence I ended up using rtdm calls instead
>> 
>> 
>> 
>>                               /dev/rtp0 is a non-real-time user-space
>>        endpoint
>>                 for the
>>                               communication, between a regular linux
>>        application
>>                 and a
>>                          real-time
>>                               component. It does not make sense to open
>>        it from
>>                 kernel space.
>> 
>> 
>>                          My intent here is to set up something similar to
>>                 xddp-echo.c
>>                            (RT - Non
>>                          RT communication) but in kernel space instead. How
>>                 should I go about
>>                          creating the Linux endpoint for XDDP in the
>>        kernel?
>> 
>> 
>>                      There is no direct way for that, this
>>        device/protocol is not
>>                      intended for this purpose. This is a regular linux
>>                 application to
>>                      Xenomai real-time communication path, nothing
>>        else. Regular
>>                 linux
>>                      applications live in userland, only.
>> 
>>                      We don't recommend building applications in kernel
>>        space.
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>                                            Do I need to install any
>>        specific xenomai
>>                          modules for
>>                                   this to work?
>> 
>> 
>>                                        Obviously, yes. Check IPC
>>        drivers in the
>>                 "Drivers"
>>                          sub-menu
>>                                   of the
>>                                        Xenomai configuration. You need
>>        to have
>>                                        CONFIG_XENO_DRIVERS_RTIPC_XDDP
>>        enabled.
>> 
>> 
>>                                   I already checked this in the
>>        configuration,
>>                 It is enabled.
>>                                   Should this
>>                                   also be set to y?
>>        CONFIG_XENO_DRIVERS_RTIPC. In my
>>                          configuration
>>                                   it is
>>                                   set to m.
>> 
>> 
>>                               Did you load the xeno_rtipc module then?
>> 
>> 
>>                          It is not loaded. But I got an error when I
>>        did that.
>>                          Xenomai: assertion failed at
>>        /.../kernel/xenomai/skins/)
>>                          Xenomai: RTDM: missing open handler
>> 
>> 
>>                      It does not make any sense. This assertion can
>>        only trigger
>>                 for a
>>                      named device, not a protocol device. RTIPC is a
>>        protocol
>>                 device.
>> 
>>                      - did you change any of the driver code?
>>                      - what command did you use to load the module,
>>        verbatim?
>> 
>>                          insmod: error inserting 'xeno_rtipc.ko': -1
>>        Invalid
>>                 parameters
>> 
>> 
>> 
>>                                   Should I see any modules loaded in
>> 
>>        /proc/xenomai/rtdm/protocol_________devices?
>> 
>> 
>>                               Yes.
>> 
>> 
>> 
>> 
>>                                            Thanks
>>                                            Shweta
>> 
>> 
>>          _________________________________________________________
>> 
>> 
>> 
>>                                            Xenomai mailing list
>>        Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>
>>        <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>>                 <mailto:Xenomai@xenomai.org
>>        <mailto:Xenomai@xenomai.org> <mailto:Xenomai@xenomai.org
>>        <mailto:Xenomai@xenomai.org>>>
>>                          <mailto:Xenomai@xenomai.org
>>        <mailto:Xenomai@xenomai.org>
>>                 <mailto:Xenomai@xenomai.org
>>        <mailto:Xenomai@xenomai.org>> <mailto:Xenomai@xenomai.org
>>        <mailto:Xenomai@xenomai.org>
>>                 <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>>>
>>                                   <mailto:Xenomai@xenomai.org
>>        <mailto:Xenomai@xenomai.org>
>>                 <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>>                          <mailto:Xenomai@xenomai.org
>>        <mailto:Xenomai@xenomai.org>
>>                 <mailto:Xenomai@xenomai.org
>>        <mailto:Xenomai@xenomai.org>>> <mailto:Xenomai@xenomai.org
>>        <mailto:Xenomai@xenomai.org>
>>                 <mailto:Xenomai@xenomai.org <mailto:Xenomai@xenomai.org>>
>>                          <mailto:Xenomai@xenomai.org
>>        <mailto:Xenomai@xenomai.org> <mailto:Xenomai@xenomai.org
>>        <mailto:Xenomai@xenomai.org>>>>__>
>>        http://www.xenomai.org/__________mailman/listinfo/xenomai
>>        <http://www.xenomai.org/________mailman/listinfo/xenomai>
>> 
>>        <http://www.xenomai.org/________mailman/listinfo/xenomai
>>        <http://www.xenomai.org/______mailman/listinfo/xenomai>>
>> 
>> 
>>          <http://www.xenomai.org/________mailman/listinfo/xenomai
>>        <http://www.xenomai.org/______mailman/listinfo/xenomai>
>>                 <http://www.xenomai.org/______mailman/listinfo/xenomai
>>        <http://www.xenomai.org/____mailman/listinfo/xenomai>>>
>> 
>> 
>> 
>>        <http://www.xenomai.org/________mailman/listinfo/xenomai
>>        <http://www.xenomai.org/______mailman/listinfo/xenomai>
>>                 <http://www.xenomai.org/______mailman/listinfo/xenomai
>>        <http://www.xenomai.org/____mailman/listinfo/xenomai>>
>> 
>>          <http://www.xenomai.org/______mailman/listinfo/xenomai
>>        <http://www.xenomai.org/____mailman/listinfo/xenomai>
>>                 <http://www.xenomai.org/____mailman/listinfo/xenomai
>>        <http://www.xenomai.org/__mailman/listinfo/xenomai>>>>
>> 
>> 
>> 
>> 
>>        <http://www.xenomai.org/________mailman/listinfo/xenomai
>>        <http://www.xenomai.org/______mailman/listinfo/xenomai>
>>                 <http://www.xenomai.org/______mailman/listinfo/xenomai
>>        <http://www.xenomai.org/____mailman/listinfo/xenomai>>
>> 
>>          <http://www.xenomai.org/______mailman/listinfo/xenomai
>>        <http://www.xenomai.org/____mailman/listinfo/xenomai>
>>                 <http://www.xenomai.org/____mailman/listinfo/xenomai
>>        <http://www.xenomai.org/__mailman/listinfo/xenomai>>>
>> 
>> 
>>        <http://www.xenomai.org/______mailman/listinfo/xenomai
>>        <http://www.xenomai.org/____mailman/listinfo/xenomai>
>>                 <http://www.xenomai.org/____mailman/listinfo/xenomai
>>        <http://www.xenomai.org/__mailman/listinfo/xenomai>>
>> 
>>          <http://www.xenomai.org/____mailman/listinfo/xenomai
>>        <http://www.xenomai.org/__mailman/listinfo/xenomai>
>>                 <http://www.xenomai.org/__mailman/listinfo/xenomai
>>        <http://www.xenomai.org/mailman/listinfo/xenomai>>>>>
>> 
>> 
>> 
>>                                        --
>>                                        Philippe.
>> 
>> 
>> 
>> 
>> 
>>                               --
>>                               Philippe.
>> 
>> 
>> 
>> 
>> 
>>                      --
>>                      Philippe.
>> 
>> 
>> 
>> 
>> 
>>             --
>>             Philippe.
>> 
>> 
>> 
>> 
>> 
>>    --
>>    Philippe.
>> 
>> 
>> 
> 
> 
> -- 
> Philippe.
> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-07-10 17:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10  2:30 [Xenomai] XDDP and inter-driver API Sunetra Sashi
2012-07-10  8:40 ` Philippe Gerum
2012-07-10  9:03   ` Sunetra Sashi
2012-07-10  9:10     ` Philippe Gerum
2012-07-10  9:17       ` Sunetra Sashi
2012-07-10  9:36         ` Philippe Gerum
2012-07-10 11:23           ` Sunetra Sashi
2012-07-10 15:01             ` Philippe Gerum
2012-07-10 15:43               ` Sunetra Sashi
2012-07-10 15:57                 ` Philippe Gerum
2012-07-10 16:15                   ` Sunetra Sashi
2012-07-10 16:24                     ` Lennart Sorensen
2012-07-10 17:00                       ` Philippe Gerum
2012-07-10 17:09                     ` Philippe Gerum
2012-07-10 17:20                       ` Snmgmt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.