Re: Adding a new interrupt handler to the IDT




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...
.



Relevant Pages

  • Re: Adding a new interrupt handler to the IDT
    ... 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. ...
    (comp.os.linux.development.system)
  • Re: IDT: local or global?
    ... interrupt know which process' table it should use? ... > If you knew how the IDT is located via the IDTR, ... > get its own debugger's handler to work for it, ... As with other signals, the mechanism is the same, and it depends upon ...
    (comp.os.linux.development.system)
  • Re: IDT: local or global?
    ... Tauno Voipio wrote: ... :> one global IDT for all processes? ... IDT (Interrupt Descriptor Table) is global. ... get its own debugger's handler to work for it, ...
    (comp.os.linux.development.system)
  • Re: em network issues
    ... driver avoids this problem. ... locking, but for many drivers fast wth interrupt handlers, whatever ... locking is used by the fast interrupt handler must be used all over ... This is safe because it has no side effects and doesn't take long. ...
    (freebsd-net)
  • Q: wait queue weirdness in A/D device driver - 2.4.18 or 20, RH 8.0
    ... "master buffer" at interrupt time and wake up any ... it should be because the int handler has now placed data into the master ... I'm using gcc 2.95.3 for both kernel and module (due to a suggestion on ... into the queue. ...
    (comp.os.linux.development.system)