Page 1 of 3

Problems with APIC on QEMU

Posted: Thu Oct 30, 2014 11:02 pm
by nextvolume
Visopsys 0.75 does not boot successfully on QEMU (tested on 2.0.0 and 2.1.0), it stays still while waiting for IDE drive interrupts.. (as compiling the kernel with debug enabled reveals). I did a bit of research and I found the culprit: it is the APIC support that was added in this very release.
Visopsys disables any old-style interrupt controllers if it finds an APIC-compatible interrupt controller.
It seems that QEMU's APIC support does not work correctly, and thus the kernel seems unable to get (at least some) interrupts.
The workaround right now is disabling the APIC driver, but as there is no way to configure a Visopsys kernel when compiling or at runtime, one first needs to comment the relevant line for the APIC driver in src/kernel/kernelDevice.c (just make a search for APIC in the file) in the sources and then build the system from sources again.
This makes Visopsys 0.75 work and boot fine on QEMU.

I made floppy, CD and USB images with APIC already disabled:
http://unhaut.fav.cc/visopsys/visopsys- ... ic-img.zip (floppy)
http://unhaut.fav.cc/visopsys/visopsys- ... ic-iso.zip (CD ISO image)
http://unhaut.fav.cc/visopsys/visopsys- ... ic-usb.zip (USB image)

You can use these with QEMU until this issue is fixed.

Re: Problems with APIC on QEMU

Posted: Fri Oct 31, 2014 12:41 am
by andymc
Ah, dang, sorry guys. I didn't test the new APIC code with Qemu, only VMware and some real systems.

I notice that when I turn on the APIC in VirtualBox things fail also.

I'll look into it.

Re: Problems with APIC on QEMU

Posted: Fri Oct 31, 2014 12:46 am
by andymc
I tried to make the new APIC code quite conservative, only enabling itself when it thinks everything is kosher, but when it does enable, it has to disable the PIC. Mixed mode is complicated, and not really recommended, so in the kernel it has to be one or the other.

Re: Problems with APIC on QEMU

Posted: Thu Dec 04, 2014 3:50 am
by andymc
Hi nextvolume,

I was seeing similar error messages in VirtualBox, but I've had difficulties setting up Qemu on my dev machine. Could you possibly try dropping this version of the APIC driver into your source tree, and see whether it solves the problems you've been seeing with missing interrupts, etc.?

I seem to have solved it in VirtualBox, and the error messages were so similar to Qemu (Ronaldees had the same error messages). It would be helpful if you guys could give it a quick test.

Re: Problems with APIC on QEMU

Posted: Thu Dec 04, 2014 4:33 pm
by andymc
Alright, I did get Qemu up and running. There are some seemingly-harmless error messages from the RTC driver, but the APIC code seems alright now.

The problem was related to prioritizing multiple interrupts-in-service, for anyone who's interested in that level of detail ;-)

Re: Problems with APIC on QEMU

Posted: Thu Dec 04, 2014 10:02 pm
by nextvolume
I dropped the file in the 0.75N1 source tree and unfortunately it does not work for me in QEMU.

Re: Problems with APIC on QEMU

Posted: Thu Dec 04, 2014 11:34 pm
by andymc
Thanks for trying it. Hmm, perhaps I changed something else in my tree (not in that file) that helps. Everything seems good with this Qemu (downloaded today) and my 0.76 tree. I was thinking I'm ready to do another release, though I will do some more testing for a few days. Do you want to try a pre-release 0.76 .iso?

Re: Problems with APIC on QEMU

Posted: Fri Dec 05, 2014 9:11 am
by nextvolume
Yes, it would be nice if I could try a prelease ISO.

Re: Problems with APIC on QEMU

Posted: Mon Dec 08, 2014 12:12 am
by andymc
Here we go. This is just about ready to release, I think, unless you guys tell me it's still seriously broken http://visopsys.org/files/visopsys/viso ... 07-iso.zip

Re: Problems with APIC on QEMU

Posted: Wed Dec 10, 2014 8:50 am
by nextvolume
Unfortunately it still won't work on QEMU, I use version 2.1.0.
Just an idea: ever thought about registering if a certain key is pressed in the OS loader, and then disabling APIC if it was?