Re: Adding a new interrupt handler to the IDT
- From: Tauno Voipio <tauno.voipio@xxxxxxxxxxxxx>
- Date: Fri, 18 Aug 2006 20:24:57 GMT
Martin Feeney wrote:
I have a system which will be creating CPU interrupts via a user-supplied IDT value. I have a kernel module which will handle the interrupt - I just need to hook this code into the interrupt handler mechanism. I cannot find any documentation on how to create an entry in the IDT or to identify the linkage protocol (assuming I can create an IDT entry).
Note: These are NOT IRQs and, therefore, the request_irq() services cannot be used. This would be equivalent to creating a handler for the INT instruction.
Are you intending to create a back-door to the kernel via
an int instruction?
Where are the non-irq interrupts coming from, and how do
the get onto the CPU chip?
No, this is not a kernel backdoor. I will be running Linux under a custom hipervisor. The hipervisor can signal the guest (i.e. Linux) via an interrupt to handle certain events. I want to insert a handler into the IDT to handle these events. I want my device driver code to use Linux services if they are available rather than writing my custom code to tweak the IDT. I just haven't found these services...
I don't have 2.6 sources available just now, but in kernel 2.4
the interrupt gates are set up in the interrupt controller
driver function init_IRQ(). The setup function is set_intr_gate().
Probably the easiest place to find the vector setup is at
/usr/src/linux/arch/i386/kernel/i8259.c.
The gate setup routines are in
/usr/src/linux/arch/i386/kernel/traps.c
You'll probably like to have a trap handler instead of an
interrupt handler in this case. The handler may need some
assembly code to work properly.
HTH
--
Tauno Voipio
tauno voipio (at) iki fi
.
- References:
- Adding a new interrupt handler to the IDT
- From: Martin Feeney
- Re: Adding a new interrupt handler to the IDT
- From: Tauno Voipio
- Re: Adding a new interrupt handler to the IDT
- From: Martin Feeney
- Adding a new interrupt handler to the IDT
- Prev by Date: Re: Adding a new interrupt handler to the IDT
- Next by Date: help!!a question to trouble me a lot in reading the driver code
- Previous by thread: Re: Adding a new interrupt handler to the IDT
- Next by thread: Re: Adding a new interrupt handler to the IDT
- Index(es):
Relevant Pages
|