From: Leopold Palomo-Avellaneda <leo@alaxarxa.net>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Xenomai list <xenomai@xenomai.org>
Subject: Re: [Xenomai] Porting a library to Xenomai
Date: Fri, 11 Dec 2015 15:03:55 +0100 [thread overview]
Message-ID: <5073889.mxMKChqctc@soho> (raw)
In-Reply-To: <20151211132012.GA24775@hermes.click-hack.org>
El Divendres, 11 de desembre de 2015, a les 14:20:12, Gilles Chanteperdrix va
escriure:
> On Fri, Dec 11, 2015 at 01:44:01PM +0100, Leopold Palomo-Avellaneda wrote:
> > Hi,
> >
> > I'm working to make a library to work with Xenomai. It's a library that
> > has a thread and open a socket to communicate with an external device via
> > network.
> >
> > I have read the guide "Porting a Linux application to Xenomai dual kernel
> > [1]" but still I have some doubts in some details. So, here my topics
> > without any importance order:
> >
> > - What is the recommended way to obtain the link, flags, etc information
> > to
> > build an application that use Xenomai? xeno-config, pkg-config, some build
> > macros to find the information, ...
>
> Quoting the document you say you have read:
:-)
> "Compilation flags
>
> To ease that task, the xeno-config script, installed when compiling
> Xenomai user-space support, is able to give you these flags. (...)
> Beware: this way of obtaining the compilation flags is recommended,
> if for anything because it will make using a different release of
> Xenomai easier: the flags may change between two different releases."
ok, but this solution implies that xeno-config must be available. In any case
as CMake user, following your indications the Macros should use xeno-config.
For what I have seen in the net, not all the people use that.
> > - I would like to have a code that could be used with an Standard POSIX or
> > a Xenomai. I thought that protecting my code with some #ifdef __XENO__ I
> > could choose which part is specific to Xenomai and which no. However, I'm
> > a bit confused, because then, I don't understand what is the utility of
> > the wrap script. Please, could you elaborate a bit more this part,
> > especially focused in an application the could use an standard network
> > interface or rtnet version.
>
> Quoting the documentation again: "Use of Linux original services
>
[....]
No Gilles, that's the point that I don't understand. Maybe it could be a
language problem.
Are you saying that, for instance using a rtnet driver, it's the same to NOT
use the wrap script and use this:
/* Open a plain Linux UDP socket. */
#ifndef __XENO__
fd = socket(PF_INET, SOCK_DGRAM, 0);
#else /* __XENO__ */
fd = rt_dev_socket(PF_INET, SOCK_DGRAM, 0);
#endif /* __XENO__ */
Or,
#ifndef __XENO__
printf("Stopping the robot.\n");
#else /* __XENO__ */
rt_printf("Stopping the robot.\n");
#endif /* __XENO__ */
And which are the implications of the use of the wrap script? Could I avoid
the use of the script protecting the wrapped functions with __XENO__ and it's
the same?
>
> > - In the document, there's a section about the mlockall option. So, may I
> > understand that from xenomai <= 2.6.3 it's not needed that I call the
> > mlockall function?
>
> Quoting the documentation again: "
> Starting with version 2.6.3, as part of their initialization,
> Xenomai libraries systematically call mlockall to commit and lock
> the whole application memory.
Ok, so why it's use it in your example:
http://www.xenomai.org/documentation/xenomai-2.6/html/api/trivial-periodic_8c-example.html
May I understand that that line is not needed?
Thanks,
Leopold
--
--
Linux User 152692 GPG: 05F4A7A949A2D9AA
Catalonia
-------------------------------------
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://xenomai.org/pipermail/xenomai/attachments/20151211/e165c3df/attachment.sig>
next prev parent reply other threads:[~2015-12-11 14:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-11 12:44 [Xenomai] Porting a library to Xenomai Leopold Palomo-Avellaneda
2015-12-11 13:20 ` Gilles Chanteperdrix
2015-12-11 14:03 ` Leopold Palomo-Avellaneda [this message]
2015-12-11 14:09 ` Gilles Chanteperdrix
2015-12-11 15:33 ` Leopold Palomo-Avellaneda
2015-12-11 16:31 ` Gilles Chanteperdrix
2015-12-15 15:16 ` Leopold Palomo-Avellaneda
2015-12-15 15:46 ` Gilles Chanteperdrix
2015-12-16 15:45 ` Leopold Palomo-Avellaneda
2015-12-17 0:05 ` Gilles Chanteperdrix
2015-12-17 9:00 ` Leopold Palomo-Avellaneda
2015-12-17 9:25 ` Gilles Chanteperdrix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5073889.mxMKChqctc@soho \
--to=leo@alaxarxa.net \
--cc=gilles.chanteperdrix@xenomai.org \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.