All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Newbee questions - concerning the native API
@ 2011-07-07 14:11 Tony Vinto
  2011-07-11 11:26 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 2+ messages in thread
From: Tony Vinto @ 2011-07-07 14:11 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 1911 bytes --]


Hi,

I apologize if I am asking questions that have been handled many times before but at mu skill level searching the list of archives and for a similar topic seems overly daunting to me.  ( Is there an application that can globally search the archives without me having to manually download each and individually un-gzipping them and then searching for keywords in each? )

I am six months into Linux programming and only a few days into Xenomai...
( I have read the API document once, and am in the second reading of the Native API Tour revC.)

Anyway my questions...

For sake of discussion these refer to the example code "trivial-periodic.c", but are really general questions.


1) Is the proceedure "demo(void *arg)" the real time part and the "main()" section standard linux?  That is, is "demo()" preempt-able or will it run forever without preemption?  if the latter, I presume that it is the coders responsibility to build in a means for the procedure to return to sleep when it has completed it's job.   ( as in the example, the "rt_task_wait_period(NULL)" call. )


2) My application will run in user space and will access a device on an SPI bus.  I will be using a user mode SPI driver and making IOCTL calls to exchange data with my device.
If I do all of my work in a real time proceedure ( like demo() in the example code ) will the IOCTL calls also be in the real time domain?  That is are they protected from preemption?


3) The API tour says "message pipes" are for exchange of data between RT user mode and regular user mode. Intertasksynchronous message passing, Message queues, and Memory heaps are for kernel mode to user mode communication... or for RT user mode to RT user mode communication.

Am I "over reading" this?  ...or can I use any of these techniques for RT-User mode to regular user mode data exchange?



Thanks for the help!
Tony
 		 	   		  

[-- Attachment #2: Type: text/html, Size: 2223 bytes --]

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

* Re: [Xenomai-help] Newbee questions - concerning the native API
  2011-07-07 14:11 [Xenomai-help] Newbee questions - concerning the native API Tony Vinto
@ 2011-07-11 11:26 ` Gilles Chanteperdrix
  0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2011-07-11 11:26 UTC (permalink / raw)
  To: Tony Vinto; +Cc: xenomai

On 07/07/2011 04:11 PM, Tony Vinto wrote:
> 
> Hi,
> 
> I apologize if I am asking questions that have been handled many
> times before but at mu skill level searching the list of archives and
> for a similar topic seems overly daunting to me.  ( Is there an
> application that can globally search the archives without me having
> to manually download each and individually un-gzipping them and then
> searching for keywords in each? )

You can use your favorite search engine, adding site:xenomai@xenomai.org

We provide a simplified way to do this at this URL. Correction, this
functionality disappeared. It must have during a mediawiki upgrade. I
will look into this.


> 
> I am six months into Linux programming and only a few days into
> Xenomai... ( I have read the API document once, and am in the second
> reading of the Native API Tour revC.)
> 
> Anyway my questions...
> 
> For sake of discussion these refer to the example code
> "trivial-periodic.c", but are really general questions.
> 
> 
> 1) Is the proceedure "demo(void *arg)" the real time part and the
> "main()" section standard linux?  That is, is "demo()" preempt-able
> or will it run forever without preemption?  if the latter, I presume
> that it is the coders responsibility to build in a means for the
> procedure to return to sleep when it has completed it's job.   ( as
> in the example, the "rt_task_wait_period(NULL)" call. )

Yes. It is also the responsibility of the coder to only use service that
will not cause a switch to secondary mode.

> 
> 
> 2) My application will run in user space and will access a device on
> an SPI bus.  I will be using a user mode SPI driver and making IOCTL
> calls to exchange data with my device. If I do all of my work in a
> real time proceedure ( like demo() in the example code ) will the
> IOCTL calls also be in the real time domain?  That is are they
> protected from preemption?

It depends how the ioctl are implemented, they will remain in primary
mode only if you only call primary-mode only services. But you can use
rt_task_set_mode to set the T_WARNSW bit, and receive a signal when this
thread switches to secondary mode.

> 
> 
> 3) The API tour says "message pipes" are for exchange of data between
> RT user mode and regular user mode. Intertasksynchronous message
> passing, Message queues, and Memory heaps are for kernel mode to user
> mode communication... or for RT user mode to RT user mode
> communication.
> 
> Am I "over reading" this?  ...or can I use any of these techniques
> for RT-User mode to regular user mode data exchange?

If you use RT to RT services, they will require the consumer thread
(assuming the producer thread is the only always in primary mode), to go
back and forth between primary and secondary mode. So, they will require
this thread to be able to switch to primary mode, that means that it
must be a xenomai thread, not a regular linux thread. Message pipes do
not have such a requirement.

-- 
                                                                Gilles.


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

end of thread, other threads:[~2011-07-11 11:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-07 14:11 [Xenomai-help] Newbee questions - concerning the native API Tony Vinto
2011-07-11 11:26 ` Gilles Chanteperdrix

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.