Segmentation fault with asm("int 0x0f")
Hi,
I am trying to write a kernel module that services IRQ 7. I look in one of my trusty HW books and this corresponds to interrupt 0x0f. However, when I call it using:
asm("int 0x0f");
from my test application, I get a "Segmentation fault". But when I substitute 0x80 for the interrupt, I don't get a Segmentation fault. I can load and unload the module fine and it appears in the /proc/interrupts table.
I am running Red Hat 9 upgraded to kernel 2.6.7.
module code
---------------
static irqreturn_t irq_handler(int irq, void *dev_id, struct pt_regs *regs)
{
return IRQ_HANDLED;
}
static int mydriver_init(void)
{
return request_irq(7, irq_handler, SA_INTERRUPT, "mydriver", NULL);
}
static void mydriver_exit(void)
{
free_irq(7, NULL);
}
module_init(mydriver_init);
module_exit(mydriver_exit);
app code
-----------
int main(void)
{
asm("int $0x0f");
return 0;
}
Thanks
Last edited by justthething; 08-02-2004 at 01:32 PM.
|