QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1376|回复: 1

kernel panic on interrupt?

[复制链接]
发表于 2005-7-3 09:12:28 | 显示全部楼层 |阅读模式
I have written a kernel module to react on an external hardware
interrupt that will occur at e.g. IRQ9  line. The idea is then my
application code could wait for an interrupt (perform an
ioctl(WAIT_ON_INTERRUPT)) and react to it.

The basic structure of this module is given below:

MyModule.o
------------------

wait_queue_head_t int_queue;

__init initModule()
{
      ...
      proper initialization, etc
      ..

//register the interrupt handler
request_irq(IRQ7,myHndlr, PORTNAME,NULL)
      
      //initialize the queue head
      init_waitqueue_head(&int_queue);
}

myHndlr()
{
      //re-wake the interrupt if asleep
wake_up_interruptible(&int_queue);
}

myIoclt()
{
      //re-init the queue head
init_waitqueue_head(&int_queue);
      
      //now wait for the interrupt
interruptible_sleep_on(&int_queue);
}


And I compiled this module using proper flags such as _MODULE _KERNEL
etc....


I know the above module coupled with my application worked very well
with kernel 2.2.20.

PROBLEM
-------
When I recently moved to kernel 2.4.20, I get a kernel panic (Oops
screen dump) every time I get the interrupt occurring. Hence, when
interrupt occurs the trace jumps to myHndlr() and kernel panic occurs at
the point of wake_up_interruptible(&int_queue);


What could this be?

Why did the identical module worked for 2.2.20 and not for 2.4.20?? (I
made sure I used the proper lib for 2.4.20 when compiling the
MyModule.o)

I have noticed slight variation of the code in /kermel/sched.c between
2.2.20 & 2.4.20, where these functions wake_up_interruptible() etc) are
defined.

Could it also be as a result of implementation of softirq functions.
Should I enable Softirq?

I tried using cpu_raise_softirq() within MyModule.o. The module compiled
correct but when I load into the kernel, I get a lot of unresolved
symbols. What about ksoftirqd_CPU0, is this interfering with the system?

Any help in this matter is appreciated.

Regards,
发表于 2005-7-3 10:49:34 | 显示全部楼层
pure-blood kernel 2.4.20 ?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-6-29 08:14 , Processed in 0.410929 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表