* [Xenomai-help] Xenomai Kernel Module & Watchdogs
@ 2008-11-12 8:41 Adrian Boeing
2008-11-12 20:03 ` Gilles Chanteperdrix
0 siblings, 1 reply; 4+ messages in thread
From: Adrian Boeing @ 2008-11-12 8:41 UTC (permalink / raw)
To: xenomai-help
[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]
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.
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
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.
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__
)
Thanks!
-Adrian
[-- Attachment #2: Type: text/html, Size: 1405 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Xenomai-help] Xenomai Kernel Module & Watchdogs
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>
0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2008-11-12 20:03 UTC (permalink / raw)
To: Adrian Boeing; +Cc: xenomai-help
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-11-14 0:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2008-11-14 0:50 ` Adrian Boeing
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.