Kernel Timers

Ravi Wijayaratne (ravi@jumprun.tamu.edu)
Tue, 12 Jan 1999 14:14:57 -0600 (CST)


Hi,
I have a question regarding the kernel timers.

I need to invoke a function inside the kernel at fixed time intervals. Say
function1.

I created function1 as follows

struct timer_list period_timer;

void function1(void)
{
printk(" period Expired \n");
period_timer.expires=jiffies + 60*HZ; /* sixty seconds */
period_timer.function = &function1;
add_timer(&period_timer);
}

I expected that every 60 seconds function1 will get invoked and print
the string given in printk.

I included this function inside ide.c and initialised the timer
appropriately.

However when I compile the kernel and boot from this kernel
function1 goes to a infinite loop and prints the string at very fast
rate. Definitely not once per minute.

What is wrong with this ?

Some help is much appreciated.

Thanx
Ravi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/