All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Adrian Boeing <aboeing@domain.hid>
Cc: Xenomai help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Xenomai Kernel Module & Watchdogs
Date: Thu, 13 Nov 2008 17:39:32 +0100	[thread overview]
Message-ID: <491C5844.2060306@domain.hid> (raw)
In-Reply-To: <c024fefc0811130016u526a45a9q4f587679e75c381c@domain.hid>

Adrian Boeing wrote:
> Hi Gilles,
> 
> Thank you for your reply.
> 
> Not necessarily, the same priority scale is available in kernel-space
>> and user-space. However, are you aware that Xenomai already has a
>> watchdog? It is selectable in Linux configuration once linux sources
>> have been prepared.
> 
> 
> Yes, I saw it mentioned in an older version of the documentation, however I
> was unable to find the option. (The documentation mentions 'expert mode' in
> the 'general' menu - I was not able to find it.)

You need to enable xenomai debugging.

> 
> I would like to create a watchdog that watches my other real & non-realtime
> threads to make sure they are not starved/stuck/error etc. and reset them if
> necessary.
> 
> The documentation on 'alarm' mentions "Create an alarm object from kernel
> space". So I assumed they must be created in a kernel module.

No, as can be seen in the documentation, there are two rt_alarm_create
functions, one for user-space, one for kernel-space

> 
> 
>> 2. How do I create a kernel module? (what is the compiler command?)
>>
>> This question is off-topic on Xenomai mailing list, it is not related to
>> xenomai at all. But you have to get the module compiled by Linux kernel
>> makefiles. See Documentation/kbuild/modules.txt in the kernel sources.
> 
> 
> Thanks for the hints. One of the examples in the Xenomai documentation is
> "kernel_task.c"
> How should I compile and run this example? I assumed it was a kernel module.
> 
> This is how I compile it at the moment:
> gcc -I/usr/include/xenomai -D_GNU_SOURCE -D_REENTRANT -D__XENO__
> -L/usr/lib -lpthread  -lnative -Xlinker -rpath -Xlinker /usr/lib  -c kmod.c
> 
> Try to run it:
> sudo insmod ./kmod.o
> 
> I get this error:
> insmod: error inserting './kmod.o': -1 Invalid module format

I repeat myself: "you have to get the module compiled by Linux kernel
makefiles. See Documentation/kbuild/modules.txt in the kernel sources."

Please do not drop the mailing list from the CC.

-- 
                                                 Gilles.


  parent reply	other threads:[~2008-11-13 16:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-12  8:41 [Xenomai-help] Xenomai Kernel Module & Watchdogs Adrian Boeing
2008-11-12 20:03 ` Gilles Chanteperdrix
     [not found]   ` <c024fefc0811130016u526a45a9q4f587679e75c381c@domain.hid>
2008-11-13 16:39     ` Gilles Chanteperdrix [this message]
2008-11-14  0:50       ` Adrian Boeing

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=491C5844.2060306@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=aboeing@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.