Hi,
Ok, "IOAPIC_IRQ_DEFAULT_LOW" works out to a level sensitive interrupt with active high trigger mode, and a logical destination address in "IOAPIC_IRQ_DEFAULT_HIGH", using "send to lowest priority" mode.
Interrupts from a PCI bus are usually level sensitive active low, but EISA is normally level sensitive active high and ISA is usually edge sensitive active high. Motherboard manufacturers can use different signals (but almost all of them don't).
Normally, I'd expect most of these interrupts to come from ISA, possibly with some connected to PCI, perhaps one with a strange looking "SCI" connection to the motherboard, and perhaps one that is meant to be "extINT" and is connected to the PIC chips (used for "mixed mode" on older SMP motherboards).
On a real computer, an ISA device (like the PIT or keyboard controller, which is meant to be edge triggered active high) you could get the same IRQ several times because the I/O APIC could get the EOI before the "pulse" sent by the device goes back to it's inactive (low) state. Alternatively, the I/O APIC might miss the pulse entirely if it's fast enough (i.e. think it was noise) because the APIC is looking for a level trigger.
AFAIK this won't effect Bochs though - it's not as realistic as real hardware.
In general, you need to find out what type of signal is connected to each I/O APIC input. There's only 2 ways to do this reliably - MP specification tables and the ACPI APIC table. There's a few "tutorials" on the internet that are just plain wrong here.
The other thing I guess I should mention, is that some I/O APICs have 24 inputs, but some have 16 and some have 28. For each I/O APIC you can read the number of inputs it has from bits 16 to 23 of it's "I/O APIC version register". My Intel datasheet calls this the Maximum Redirection Entry, and says that this value can range from 0 through to 239 (from 1 to 240 inputs).
Also, some computers have more than one I/O APIC. For example, my server here has 2 I/O APICs with 16 inputs each (32 IRQ's total).
In logical destination mode, the I/O APIC will take the destination address (0xFF000000) and broadcast it to all CPUs.
Each CPU will get this value and do a "logical AND" with it's local APIC's destination format register. This determines which bits are important and which bits are ignored. Then it gets the result and does another "logical AND" with it's local APIC's logical destination register. After this, if any bits are still set the local APIC accepts the interrupt.
If more than one CPU accepts the interrupt, then the CPUs will work who is the lowest priority and any other CPUs will ignore the interrupt.
This makes me wonder if you've setup each CPU's local APIC properly.
For example, if the local APIC's logical destination register is left with it's default value (0x00000000) then this final "logical AND" will leave no bits set and the CPU won't accept the interrupt.
FlashBurn wrote:Also now it is vector 0x40 and if I run Bochs in 1 cpu mode it is also vector 0x41 which stucks.
That would be the PIT (IRQ0) which keeps on trying to interrupt and doesn't stop, and occasionally you'd get one from the keyboard (IRQ1) which only happens once because you don't get the scancode out of the keyboard controller chip...
Cheers,
Brendan