Hi,
I think the message is self explanatory. You're writing a word instead of a dword (IOAPIC registers are 32 bit wide). Just because it's MMIO, doesn't mean you can write to it at any offset with any granularity, you must write to the whole register at once.
If you use C (as I suspect from the disassembly), then you should use
Code:
*((uint32_t*)IOAPIC_regX) = X;
and *not*
Code:
*((uint16_t*)IOAPIC_regX) = X;
If you don't intentionally write to the IOAPIC as you say, then you probably have an out of bound indexing issue. Generate a symbol table text file from your code. If you're using elf, you can use
Code:
nm kernel.elf | grep -ve '^ ' | cut -d ' ' -f 1,3 >kernel.sym
(note there's a space in both strings). Otherwise it's just a simple text file, with hex addresses (without the "0x" prefix), a space, and a symbol name in each line. Example:
Code:
0000000000007C00 bootsector
0000000000100080 _start
0000000000100100 pic_eoi
0000000000100200 ksleep
...
Then load that file into bochs with
Code:
<bochs:0> ldsym global "kernel.sym"
After that bochs disassembler will tell you exactly in which function the IOAPIC write occurs (address 0000000000101278 looks like inside your kernel, or if not, then there's your problem: you're executing random garbage in memory).
Alternatively you could do
Code:
objdump -d kernel.elf | less
search for the address "1278:", and scroll up to see the function name.
Btw, IOAPIC is not the same as APIC, and no PIC cannot be used as APIC (nor as IOAPIC), but they can be used as PIC if emulation is enabled (which is usually the case for compatiblity).
Cheers,
bzt