From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Re: get the simulator running...
Date: Sat, 18 Mar 2006 19:37:37 +0100 [thread overview]
Message-ID: <441C5371.1080208@domain.hid> (raw)
In-Reply-To: <441C4460.9030103@domain.hid>
[-- Attachment #1.1: Type: text/plain, Size: 1218 bytes --]
Philippe Gerum wrote:
> Philippe Gerum wrote:
>> Jan Kiszka wrote:
>> Fortunately, I had that demo I once produced
>>
>>> (last year), but that one was easier to build. I first had to drag in
>>> the libs and includes of both the simulator and a regular xenomai
>>> installation (I think to remember this once worked without this
>>> add-ons). Then I need this additional trick in the simulators include
>>> dir:
>>>
>>> mkdir asm
>>> ln -s <xeno-inst-dir>/include/asm-sim asm/xenomai
>>>
>>> This maps #include <asm/xenomai/system.h> to the correct "arch".
>>> Shouldn't this be created automatically during the simulator
>>> installation? Or is something else broken on my box?
>>>
>>
>> You clearly should not need this trick to compile apps against the
>> simulation environment; the instrumenter (gcic) sets the proper flags.
>> I'm going to rebuild one and let you know.
>
> Confirmed. You don't need this hand-made link.
>
Err, "confirmed" means that it works for you without the link and the
extra paths for gcic? The compilation of the simulator runs fine with
latest SVN here, but gcic still does not know any include paths.
Attached is the native skin demo I tried.
Jan
[-- Attachment #1.2: nat-demo.c --]
[-- Type: text/plain, Size: 2543 bytes --]
/*
* nat-demo.c
*
* Simple demonstration for a native-skin application inside the MVM simulator
* (C) 2005-2006 by Jan Kiszka <jan.kiszka@domain.hid>
*
* 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 <native/task.h>
#include <native/sem.h>
RT_TASK demo_task1;
RT_TASK demo_task2;
RT_SEM sem;
void demo1(void *arg)
{
RTIME now, previous;
rt_task_set_periodic(NULL, TM_NOW, 1000000000);
previous = rt_timer_read();
while (1) {
rt_task_wait_period(NULL);
now = rt_timer_read();
printk("%s: delay since last invocation:: %ld.%06ld ms\n",
__FUNCTION__,
(long)(now - previous) / 1000000,
(long)(now - previous) % 1000000);
previous = now;
rt_sem_v(&sem);
}
}
void demo2(void *arg)
{
RTIME now, previous;
previous = rt_timer_read();
while (1) {
rt_sem_p(&sem, TM_INFINITE);
now = rt_timer_read();
printk("%s: delay since last invocation:: %ld.%06ld ms\n",
__FUNCTION__,
(long)(now - previous) / 1000000,
(long)(now - previous) % 1000000);
previous = now;
}
}
/* Note: simulator requires exactly this function name! */
int __xeno_user_init(void)
{
rt_task_create(&demo_task1, "kdemo1", 0, 99, 0);
rt_task_create(&demo_task2, "kdemo2", 0, 98, 0);
rt_sem_create(&sem, NULL, 0, S_PRIO);
rt_task_start(&demo_task1, &demo1, NULL);
rt_task_start(&demo_task2, &demo2, NULL);
return 0;
}
/* Note: simulator requires exactly this function name! */
void __xeno_user_exit(void)
{
rt_task_delete(&demo_task1);
rt_task_delete(&demo_task2);
rt_sem_delete(&sem);
}
module_init(__xeno_user_init);
module_exit(__xeno_user_exit);
MODULE_LICENSE("GPL");
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2006-03-18 18:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-18 15:21 [Xenomai-core] get the simulator running Jan Kiszka
2006-03-18 17:01 ` Gilles Chanteperdrix
2006-03-18 17:23 ` Jan Kiszka
2006-03-18 17:25 ` [Xenomai-core] " Philippe Gerum
2006-03-18 17:33 ` Philippe Gerum
2006-03-18 18:37 ` Jan Kiszka [this message]
2006-03-18 18:45 ` Philippe Gerum
2006-03-18 18:56 ` Jan Kiszka
2006-03-19 12:08 ` Philippe Gerum
2006-03-19 12:48 ` Jan Kiszka
2006-03-18 17:30 ` Philippe Gerum
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=441C5371.1080208@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=rpm@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.