Finding the interrupt vector of a given IRQ
Chauhan, Himanshu
hschauhan at nulltrace.org
Sun May 27 21:07:23 EDT 2012
AKAIK I think is possible. For example int 3 in x86 is actually an
interrupt so to say. I don't want to go in other details about exception vs
interrupts and stack saving. But in short you can achieve what you are
trying here.
Search for breakpoint handler probably in entry.S and from the trace back
to IDT initialization. Replace the vector 3 with your handlers address. Now
you can do int 3 from elsewhere in inline assembly.
On May 28, 2012 3:40 AM, "Mark Farnell" <mark.farnell at gmail.com> wrote:
>
> This is for an assignment, where the student needs to write an
> interrupt handler.
>
> Since the OS is run on a virtual machine, I need to find a way to
> trigger the IRQ to let the students' interrupt handler to handle the
> interrupt.
>
>
>
>
>
> On Mon, May 28, 2012 at 9:27 AM, richard -rw- weinberger
> <richard.weinberger at gmail.com> wrote:
> > On Sun, May 27, 2012 at 2:02 AM, Mark Farnell <mark.farnell at gmail.com>
wrote:
> >> In the kernel, how can I find out the interrupt vector number of a
> >> given IRQ (for example, IRQ7)?
> >>
> >> Within the kernel module, I would like to manually set the IRQ using
> >> the assembly code:
> >>
> >> asm("int $<irq vector>");
> >>
> >> and let the IRQ handler installed by a different module catch that
interrupt.
> >>
> >> Is this possible?
> >
> > No really because not all IRQ have an interrupt line to the CPU.
> > Linux can multiplex and emulate them. Think of GPIO drivers with
> > interrupt support.
> > Anyway, why to you think you need to trigger the raw IRQ manually?
> > This sounds really odd...
> >
> >
> > --
> > Thanks,
> > //richard
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120528/735f59b7/attachment.html
More information about the Kernelnewbies
mailing list