bochs I/O apic write with len=2 (should be 4)
Posted: Tue Feb 26, 2019 2:51 pm
When running my OS in qemu, or just hardware, it runs fine, with no problems. However, when I run it in bochs, it prints nothing, and fails, with the error "00243442083p[IOAPIC] >>PANIC<< I/O apic write with len=2 (should be 4) at address 0x0000fec00020".
(Text should be displayed, it does in qemu and hardware)
I stepped through in bochs to see where the error occurs:
It repeats those instructions loads of times, then errors. I'm not sure why, since I'm not even using the I/O APIC for interrupts (unless the APIC can be treated as the PIC until it is enabled). I believe the error is due to sending EOI to the PIC, because ever since I started handling interrupts, bochs stopped working. IRQ 0 is the only interrupt that has function, the others I just ignore.
This is how I send the EOI:
The error also could be due to my ksleep function, as bochs panics whilst executing it (I think from the stepping above). I also made that around the same time bochs stopped working.
You can see any code on my git repository: https://github.com/chez4/burnsOS/tree/master/x86/src Files that are relevant: boot.asm kmain.c system.c
(Text should be displayed, it does in qemu and hardware)
I stepped through in bochs to see where the error occurs:
Code: Select all
<bochs:866>
Next at t=213053579
(0) [0x000000101278] 0008:0000000000101278 (unk. ctxt): cmp eax, edx ; 39d0
<bochs:867>
Next at t=223053579
(0) [0x000000101270] 0008:0000000000101270 (unk. ctxt): mov word ptr ds:[eax], cx ; 668908
<bochs:868>
Next at t=233053579
(0) [0x000000101270] 0008:0000000000101270 (unk. ctxt): mov word ptr ds:[eax], cx ; 668908
<bochs:869>
Next at t=243053579
(0) [0x000000101278] 0008:0000000000101278 (unk. ctxt): cmp eax, edx ; 39d0
<bochs:870>
00243442083p[IOAPIC] >>PANIC<< I/O apic write with len=2 (should be 4) at address 0x0000fec00020
This is how I send the EOI:
Code: Select all
eoi:
mov al, 0x20
out 0x20, al
ret
You can see any code on my git repository: https://github.com/chez4/burnsOS/tree/master/x86/src Files that are relevant: boot.asm kmain.c system.c