I'm starting out implementing/researching SMP for my kernel, now that i have threading and userspace in place without it Now, without any modification my fine-running kernel crashes as soon as i compile bochs with --enable-smp (it works with QEMU). The problem i'm facing is a spurious interrupt 0x2C. from what i see when debugging this code from bochs' apic.cc:
Code: Select all
882 int vector = highest_priority_int(irr);
883 if (vector < 0) goto spurious;
884 if((vector & 0xf0) <= get_ppr()) goto spurious;
Code: Select all
(gdb) p /x irr
$19 = {0x0 <repeats 44 times>, 0x1, 0x0 <repeats 211 times>}
(gdb) p /x isr
$20 = {0x0 <repeats 35 times>, 0x1, 0x0 <repeats 220 times>}
(gdb) p /x get_ppr()
$21 = 0x20
(gdb) p /x vector
$22 = 0x2c
the actual problem why i found this issue is that my spurious interrupt vector makes the kernel crash because it is (seems so) not reentrant
oh - and my spurious interrupt vector is currently 33 (0x21), thus a higher priority than all others... bad?
Thanks, Markus