Re: [Xenomai-core] [RFC] Xenomai examples repository

2006-11-30 Thread Jan Kiszka
Philippe Gerum wrote:
 On Thu, 2006-11-30 at 00:05 +0100, Jan Kiszka wrote:
 
 [...]
 
 To give it a start (and finally establish the infrastructure), I
 copied/reformatted some existing examples and created a simple,
 self-contained build system around them. The directory structure would
 be as I suggested:

 /examples/native/...
 /examples/posix/...
 /examples/...
 /examples/rtdm/generic/...
 /examples/rtdm/serial/...
 /examples/rtdm/...

 I derived a generic Makefiles from my own one for tests (which was in
 turn derived from previous work by Hannes Mayer). It can compile a given
 list of user space applications and kernel modules (2.4 and 2.6) 
 
 The 2.4 section looks x86-dependent. Compiling out-of-tree modules with
 2.4 over ppc would require a bit more magic to find the actual flags
 needed.

It's just the arch-independent set of flags. And, yes, this happens to
work for good old x86. :)

We have a nice but complex flag catcher in RTnet (I think it was once
developed for RTAI), but I really wanted to keep this simple. Still, any
patches/hints about additionally required flags for PPC are welcome!

 
 against
 some Xenomai installation (make XENO=..., unless xeno-config is already
 in $PATH) or a Xenomai-kernel (make KSRC=...). Moreover, there is simple
 Makefile under /examples just to kick building/cleaning of all subdirs
 at once.

 If it's OK for everyone, I would check this into trunk. We could then
 migrate existing demo code and snippets over and add new stuff as it
 pops up, both hopefully with the help of interested users.
 
 Ok, let's merge this.
 

Will do.

Jan



signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [RFC] Xenomai examples repository

2006-11-30 Thread Philippe Gerum
On Thu, 2006-11-30 at 19:12 +0100, Philippe Gerum wrote:
 On Thu, 2006-11-30 at 00:05 +0100, Jan Kiszka wrote:
 
 [...]
 
  To give it a start (and finally establish the infrastructure), I
  copied/reformatted some existing examples and created a simple,
  self-contained build system around them. The directory structure would
  be as I suggested:
  
  /examples/native/...
  /examples/posix/...
  /examples/...
  /examples/rtdm/generic/...

Btw, the heartbeat example should rather go under rtdm/i386,

  /examples/rtdm/serial/...

and this one does contain generic stuff, so you may want to provide
rtdm/generic and rtdm/arch dirs here.

  /examples/rtdm/...
  
  I derived a generic Makefiles from my own one for tests (which was in
  turn derived from previous work by Hannes Mayer). It can compile a given
  list of user space applications and kernel modules (2.4 and 2.6) 
 
 The 2.4 section looks x86-dependent. Compiling out-of-tree modules with
 2.4 over ppc would require a bit more magic to find the actual flags
 needed.
 
  against
  some Xenomai installation (make XENO=..., unless xeno-config is already
  in $PATH) or a Xenomai-kernel (make KSRC=...). Moreover, there is simple
  Makefile under /examples just to kick building/cleaning of all subdirs
  at once.
  
  If it's OK for everyone, I would check this into trunk. We could then
  migrate existing demo code and snippets over and add new stuff as it
  pops up, both hopefully with the help of interested users.
 
 Ok, let's merge this.
 
-- 
Philippe.



___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [RFC] Xenomai examples repository

2006-11-29 Thread Philippe Gerum
On Wed, 2006-11-29 at 11:43 +0100, Jan Kiszka wrote:
 Hi,
 
 we had this topic a few times before, but it's getting more and more
 urgent now: How to establish a repository for Xenomai example code?
 
 I think we have basically two options:
 
  A) create /examples/skin, including /examples/rtdm/profile in the
 SVN
 
  B) create corresponding pages in the wiki
 
 Option A) has the advantage that we could easily integrate the example
 build in the regular build process (when building SVN check-outs), track
 API changes, and keep the examples in sync that way.
 
 Option B) would be easier to maintain by non-core developers as the wiki
 is open for anyone. Both options require some review of the examples
 anyway, but B) would allow to relax the process a bit.
 

Nothing prevents to have both. A set of canonical examples carefully
maintained with the core, and a Wiki area for keeping a slew of hands-on
examples.

 Please comment everyone, even if your are only a user, but maybe
 interested in contributing example code in the future.
 
 Mahlzeit,
 Jan
 
 ___
 Xenomai-core mailing list
 Xenomai-core@gna.org
 https://mail.gna.org/listinfo/xenomai-core
-- 
Philippe.



___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [RFC] Xenomai examples repository

2006-11-29 Thread Jan Kiszka
Philippe Gerum wrote:
 On Wed, 2006-11-29 at 11:43 +0100, Jan Kiszka wrote:
 Hi,

 we had this topic a few times before, but it's getting more and more
 urgent now: How to establish a repository for Xenomai example code?

 I think we have basically two options:

  A) create /examples/skin, including /examples/rtdm/profile in the
 SVN

  B) create corresponding pages in the wiki

 Option A) has the advantage that we could easily integrate the example
 build in the regular build process (when building SVN check-outs), track
 API changes, and keep the examples in sync that way.

 Option B) would be easier to maintain by non-core developers as the wiki
 is open for anyone. Both options require some review of the examples
 anyway, but B) would allow to relax the process a bit.

 
 Nothing prevents to have both. A set of canonical examples carefully
 maintained with the core, and a Wiki area for keeping a slew of hands-on
 examples.
 

To give it a start (and finally establish the infrastructure), I
copied/reformatted some existing examples and created a simple,
self-contained build system around them. The directory structure would
be as I suggested:

/examples/native/...
/examples/posix/...
/examples/...
/examples/rtdm/generic/...
/examples/rtdm/serial/...
/examples/rtdm/...

I derived a generic Makefiles from my own one for tests (which was in
turn derived from previous work by Hannes Mayer). It can compile a given
list of user space applications and kernel modules (2.4 and 2.6) against
some Xenomai installation (make XENO=..., unless xeno-config is already
in $PATH) or a Xenomai-kernel (make KSRC=...). Moreover, there is simple
Makefile under /examples just to kick building/cleaning of all subdirs
at once.

If it's OK for everyone, I would check this into trunk. We could then
migrate existing demo code and snippets over and add new stuff as it
pops up, both hopefully with the help of interested users.

Jan
Index: examples/rtdm/serial/cross-link.c
===
--- examples/rtdm/serial/cross-link.c   (Revision 0)
+++ examples/rtdm/serial/cross-link.c   (Revision 0)
@@ -0,0 +1,336 @@
+/*
+ * cross-link.c
+ *
+ * Userspace test program (Xenomai native skin) for RTDM-based UART drivers
+ * Copyright 2005 by Joerg Langenberg [EMAIL PROTECTED]
+ *
+ * Updates by Jan Kiszka [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include stdio.h
+#include signal.h
+#include unistd.h
+#include sys/mman.h
+
+#include native/task.h
+#include native/timer.h
+
+#include rtdm/rtserial.h
+
+#define MAIN_PREFIX   main : 
+#define WTASK_PREFIX  write_task: 
+#define RTASK_PREFIX  read_task: 
+
+#define WRITE_FILErtser0
+#define READ_FILE rtser1
+
+int read_fd  = -1;
+int write_fd = -1;
+
+#define STATE_FILE_OPENED 1
+#define STATE_TASK_CREATED2
+
+unsigned int read_state = 0;
+unsigned int write_state = 0;
+
+/*   --s-ms-us-ns */
+RTIME write_task_period_ns =1llu;
+RT_TASK write_task;
+RT_TASK read_task;
+
+static const struct rtser_config read_config = {
+   0x, /* config_mask */
+   115200, /* baud_rate */
+   RTSER_DEF_PARITY,   /* parity */
+   RTSER_DEF_BITS, /* data_bits */
+   RTSER_DEF_STOPB,/* stop_bits */
+   RTSER_DEF_HAND, /* handshake */
+   RTSER_DEF_FIFO_DEPTH,   /* fifo_depth*/
+   RTSER_DEF_TIMEOUT,  /* rx_timeout */
+   RTSER_DEF_TIMEOUT,  /* tx_timeout */
+   RTSER_DEF_TIMEOUT,  /* event_timeout */
+   RTSER_RX_TIMESTAMP_HISTORY, /* timestamp_history */
+   RTSER_EVENT_RXPEND  /* event mask */
+};
+
+static const struct rtser_config write_config = {
+   0x, /* config_mask */
+   115200, /* baud_rate */
+   RTSER_DEF_PARITY,   /* parity */
+   RTSER_DEF_BITS, /* data_bits */
+   RTSER_DEF_STOPB,/* stop_bits */
+   RTSER_DEF_HAND, /* handshake */
+   RTSER_DEF_FIFO_DEPTH,   /* fifo_depth*/
+   RTSER_DEF_TIMEOUT,  /* rx_timeout */
+   RTSER_DEF_TIMEOUT,  /* tx_timeout */
+   RTSER_DEF_TIMEOUT,  /*