FreeBSD kernel timer infrastructure

Hi guys,

I'm experimenting with the FreeBSD kernel in these days just because I'd like to have a bit of experience also with it and not to stick to the Linux kernel only.
Let's say I have a kernel module that, when loaded, print "Hello, World!" on the console every 5 seconds, what do I need to do?
I've found very few information regarding callout_* functions, are they right? I tried to write an example but I can't get them work at all.

Thanks for your help.

sirus
 
Example:
Code:
"main"(...)
static struct callout echo_callout;
...
callout_init(&echo_callout, CALLOUT_MPSAFE);
callout_reset(&echo_callout, 5 * hz, echo_callout_function, NULL);
...

echo_callout_function(...)
...
callout_schedule(&echo_callout, 5 * hz);
...
 
Back
Top