Re: Interrupts & IDT on i386

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Thomas,

On 12/30/05, Thomas Petazzoni <thomas.petazzoni@xxxxxxxx> wrote:
> Hi
>
> [ Top-posting is a bad idea. Please don't. See
> http://en.wikipedia.org/wiki/Top-post ]

I forgot about it. anyway will do it from now on.

> Bhanu Kalyan Chetlapalli wrote:
>
> >         The Processor gets interrupts through the PIC 8259A. Hence
> > during bootup we reprogram the 8259A to remap the IRQs from 0-31 range
> > to a more reasonable range.
>
> I'm not sure of the state of the 8259A at bootup (not sure it maps IRQs
> to interrupts 0-31), but anyway, you need to program it to redirect IRQs
> to a range of processor interrupts that are available.
>
> > For Example if we have an interrupt for an NIC, it will be shown as,
> > lets say, 17 in the PCI config space. But the 8259A (when we reprogram
> > it manually in the kernel) will remap it to some value like 49 or so.
> > So while registering the IRQ we use the same number 17 only to
> > register it. which is why ifconfig & /proc/interrupts show the number
> > - 17. The actual interrupt handler descriptor is placed at Index of 49
> > in the IDT.
>
> You got it.

There is just one more doubt. When we recieve an interrupt and the
interrupt handler function (which we give in request_irq) is called,
We are passed a number of the IRQ. i.e. in the prototype for the
handler, the - int irq.

irqreturn_t tulip_interrupt(int irq, void *dev_instance, struct pt_regs *regs)

This number corresponds to the number - 17 (from the prev analogy). So
does the kernel convert the number 49, when an interrupt occurs, back
into 17 and give it to the handler? Does the kernel maintain a mapping
somewhere? can you give me a pointer to the kernel code which does
this?

>
> Sincerly,
>
> Thomas
> --
> Thomas Petazzoni
> thomas.petazzoni@xxxxxxxx
>
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
>
>

Thanks & Regards,
Bhanu.
--
The difference between Theory and Practice is more so in Practice than
in Theory.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux