<p>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.</p>
<p>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.</p>
<p>On May 28, 2012 3:40 AM, "Mark Farnell" <<a href="mailto:mark.farnell@gmail.com">mark.farnell@gmail.com</a>> wrote:<br>
><br>
> This is for an assignment, where the student needs to write an<br>
> interrupt handler.<br>
><br>
> Since the OS is run on a virtual machine, I need to find a way to<br>
> trigger the IRQ to let the students' interrupt handler to handle the<br>
> interrupt.<br>
><br>
><br>
><br>
><br>
><br>
> On Mon, May 28, 2012 at 9:27 AM, richard -rw- weinberger<br>
> <<a href="mailto:richard.weinberger@gmail.com">richard.weinberger@gmail.com</a>> wrote:<br>
> > On Sun, May 27, 2012 at 2:02 AM, Mark Farnell <<a href="mailto:mark.farnell@gmail.com">mark.farnell@gmail.com</a>> wrote:<br>
> >> In the kernel, how can I find out the interrupt vector number of a<br>
> >> given IRQ (for example, IRQ7)?<br>
> >><br>
> >> Within the kernel module, I would like to manually set the IRQ using<br>
> >> the assembly code:<br>
> >><br>
> >> asm("int $<irq vector>");<br>
> >><br>
> >> and let the IRQ handler installed by a different module catch that interrupt.<br>
> >><br>
> >> Is this possible?<br>
> ><br>
> > No really because not all IRQ have an interrupt line to the CPU.<br>
> > Linux can multiplex and emulate them. Think of GPIO drivers with<br>
> > interrupt support.<br>
> > Anyway, why to you think you need to trigger the raw IRQ manually?<br>
> > This sounds really odd...<br>
> ><br>
> ><br>
> > --<br>
> > Thanks,<br>
> > //richard<br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</p>