I want to understand how HW IRQ does work on a physical layer. I ask my question considering a specific example. As known after a packet coming to a network adapter a hardware interrupt is signalling. Wiki says that
an interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention.
I know that OS will be invoke a corresponding interrupt handler when the interrupt's type will be detected. But I don't understand how does CPU detect and distinguish incoming interrupts. Now I ask my questions:
First, why CPU does know that the interrupt is coming from network adapter, but not from other devices?
Second, Where does interrupt handlers registered in CPU? Is there exist a specific CPU's area which contains handler's addresses registered by OS?