the CPU interrupt handler

Kan Cai kcai at
Sat Apr 5 01:24:56 PST 2003

On Fri, 4 Apr 2003, Terry Lambert wrote:

> Kan Cai wrote:
> >   I am trying to locate the CPU interrupt handler, but with no luck. I
> > guess it is somewhere in the "1386" folder, but not sure which file is
> > doing the job. Could someone there shed some lights on this?
> >
> >   Since I am trying to capture the NIC interrupts, so it should not be
> > exceptions. Thanks a lot.
> You need to look at an existing NIC driver to see how it
> grabs interrupts.  The functions you are probably interested
> in are bus_setup_intr() and bus_teardown_intr().
> If you are trying to do this in an evil, i386 way, because you
> want to intercept the interrupt path for some legitimate
> instrumentation purpose, or because you have some wrong idea
> that this will make your networking product run faster, then
> you could do worse than to look at the functions "inthand_*"
> in /usr/src/sys/i386/isa/intr_machdep.c.

Thanks a lot for this info, but I guess I didn't express myself clearly.
The real goal of mine is to insert a timer into where the processor
gets interrupted, switches the context, and finally calls the
corresponding handlers.

After reading the intr_machdept.c, I am kinda doubt that it is the right
file I should focus, it mainly does the setup and remove entries in GDT
and IDT, doesn't it? I found that in "apic_vector.s", there is a function
called "INTR", is that true that I should put my timer in this function?

Any related info is highly appreciated.


> -- Terry

More information about the freebsd-questions mailing list