[LCP]Re: Deamons and System calls
Srinath
redindian at zxmail.com
Fri Sep 14 17:11:13 UTC 2001
Hello Manu,
>b) Can we design a system call which will call the
>modules that we created?
Yes u can; and ive typed the sketch of how to do.
********************************************************
include all the headers
static void somedisplayfunction(void * someparameter)
{
/*your display goes here BUT REMEMBER WITH PRINTK */
}
/*This is MANU'S interrupt handler function*/
void irq_handler(int irq, void *dev_id, struct pt_regs *regs)
{
static struct tq_struct task = {NULL, 0, somedisplayfunction,
&someparameter};
/*use the queue_task function here with the task struct*/
/*use the mark_bh function here*/
}
int init_module()
{
/*register here also x is the irq number */
free_irq(x, NULL);
return request_irq(x,irq_handler, SA_SHIRQ,"name",NULL);
}
void cleanup_module()
{
/*unregister here*/
free_irq(1, NULL);
}
Hope that helps you,
Srinath
More information about the linuxCprogramming
mailing list