All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Adrian Boeing <me@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Xenomai Kernel Module & Watchdogs
Date: Wed, 12 Nov 2008 21:03:06 +0100	[thread overview]
Message-ID: <491B367A.1050207@domain.hid> (raw)
In-Reply-To: <c024fefc0811120041l71143d5dic1980a06d89a1317@domain.hid>

Adrian Boeing wrote:
> Hi,
> 
> I'm new to Xenomai, and wanted to know how to create a watchdog. It is my
> understanding that high priority periodic watchdog alarms need to be created
> in kernel mode.

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.

> 
> I would like to know:
> 1. Are there any tutorials/examples for Xenomai? I am aware of the examples
> at:
> http://www.xenomai.org/documentation/branches/v2.4.x/html/api/index.html
> and
> http://www.captain.at/xenomai.php

See the examples directory in xenomai distribution.

> 
> 2. How do I create a kernel module? (what is the compiler command?)
> If I try defining "__KERNEL__" and "MODULE" then I get a large number of
> errors in the xenomai/linux includes.

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.

> 
> I would like to create a simple 'hello world' module:
> 
> #include <nucleus/module.h>
> #include <native/task.h>
> 
> int init_module(void) {
>  printk("<1>Hello World 1.\n");
>  return 0;
> }
> 
> void cleanup_module(void) {
>  printk(KERN_ALERT,"Goodbye world 1.\n");
> }
> (The first error I recieve on compiling is "error: variable or field
> 'xnpod_declare_tbase_proc' declared void", using
> g++ hello.c -c -I/usr/include/xenomai -D_GNU_SOURCE -D_REENTRANT -D__XENO__
> )

the linux kernel is C only, there is no C++, and actually, trying to
compile C++ in kernel-space is a major PITA.

-- 
					    Gilles.


  reply	other threads:[~2008-11-12 20:03 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 [this message]
     [not found]   ` <c024fefc0811130016u526a45a9q4f587679e75c381c@domain.hid>
2008-11-13 16:39     ` Gilles Chanteperdrix
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=491B367A.1050207@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=me@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.