Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Apr 2003 01:24:54 -0800 (PST)
From:      Kan Cai <kcai@cs.ubc.ca>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: the CPU interrupt handler
Message-ID:  <Pine.GSO.4.53.0304050118090.16857@granville.cs.ubc.ca>
In-Reply-To: <3E8E2418.9B46EBDD@mindspring.com>
References:  <Pine.GSO.4.53.0304041458570.13911@granville.cs.ubc.ca> <3E8E2418.9B46EBDD@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help


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.

Cheers,
ken

>
> -- Terry
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.53.0304050118090.16857>