From: Stefan Kisdaroczi <kisda@domain.hid>
To: Shashank Bhatia <shashank.bhatia@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] RT Task as a kernel module halts the whole system
Date: Mon, 25 May 2009 16:02:32 +0200 [thread overview]
Message-ID: <4A1AA4F8.80101@domain.hid> (raw)
In-Reply-To: <200905251501.25400.shashank.bhatia@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 1852 bytes --]
Hi,
Shashank Bhatia schrieb:
> Dear All,
>
> I wrote a simple RT task to be run as kernel module and tried to
> run it. As soon as i issue the insmod command, it halts the whole system.
> Please help me out,
>
> The code is as follows:
> [...]
>
> err = rt_alarm_create(&alarm,"myAlarm");
looking at the xenomai docs [1], there are two rt_alarm_create() functions,
one for kernel-space and one for userspace:
int rt_alarm_create (RT_ALARM *alarm, const char *)
Create an alarm object from user-space.
int rt_alarm_create (RT_ALARM *alarm, const char *name, rt_alarm_t handler, void *cookie)
Create an alarm object from kernel space.
It seems you are using the wrong one.
For a user-space alarm example and other code-snippets look in the directory
ksrc/skins/native/snippets/
kisda
[1] http://www.xenomai.org/documentation/branches/v2.4.x/html/api/index.html
> err = rt_alarm_start(&alarm,ALARM_VAL,ALARM_INT);
>
> err=rt_task_create(&alarm_handler, "ALARMtask",STAK_SIZE,TASK_PRI,TASK_MODE);
>
> if(!err)
> rt_task_start(&alarm_handler,&alarm_hand_func,NULL);
>
> return 0; // A non-zero return means
> hello_init failed; the module can't be loaded.
> }
>
> // End/Cleanup function
> static void hello_exit(void) {
>
> //rt_task_delete(&alarm_handler);
>
> rt_alarm_delete(&alarm);
>
> printk(KERN_ALERT "Goodbye world!\n");
> }
>
> module_init(hello_init);
> module_exit(hello_exit);
>
> -------------------------------------
> Hi-Tech Gears Limited, Gurgaon, India
>
>
>
>
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
prev parent reply other threads:[~2009-05-25 14:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-25 9:31 [Xenomai-help] RT Task as a kernel module halts the whole system Shashank Bhatia
2009-05-25 14:02 ` Stefan Kisdaroczi [this message]
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=4A1AA4F8.80101@domain.hid \
--to=kisda@domain.hid \
--cc=shashank.bhatia@domain.hid \
--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.