Hi,
My first post here. I am having fun writing a kernel, and I use Bochs and Virtualbox to emulate hardware. I have written an OHCI driver which works on VirtualBox, but when I try the same thing on Bochs it hangs right after i enable all interrupts (except SOF, like explained in 5.1.1.4 in the OHCI definition). It works in VirtualBox.
Even stranger: When I don't enable the interrupts it works in Bochs, but now HcInterruptStatus never changes in VirtualBox, so then it doesn't work there. I don't understand this either, as I understand that HcInterruptEnable is not needed for HcInterruptStatus to be set, it just means that if it is set a hardware interrupt is generated.
(From 7.1.4:
When a bit becomes set, a
hardware interrupt is generated if the interrupt is enabled in the HcInterruptEnable register (see
Section 7.1.5) and the MasterInterruptEnable bit is set
)
My conclusion is that I am doing something wrong, but I have followed the specification close (I think), and it actually works on both Bochs and VB - but not with the same kernel! Any suggestions from more experienced os developers out there?
Edit: Changed HcInterruptStatus to HcInterruptEnable
Bochs and interrupts (OHCI trouble)
-
- Posts: 3
- Joined: Wed Sep 12, 2012 1:12 pm
Re: Bochs and interrupts (OHCI trouble)
Just to add something that might be important: The host machine running VB and Bochs is an old laptop, so it could of course be some sort of performance issue. But it runs smooth in VB when it works.
Re: Bochs and interrupts (OHCI trouble)
How attached are you to bochs?
I suggest you try two approaches, depending on what you feel is more important for your OS:
I suggest you try two approaches, depending on what you feel is more important for your OS:
- Use VirtualBox's OHCI and QEMU's OHCI implementation, but not the Bochs OHCI implementation
- Write a UHCI driver for the Bochs UHCI implementation, and disable the Bochs OHCI implementation in your bochsrc
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Bochs and interrupts (OHCI trouble)
How do you think your driver will fare on real hardware when you're only able to support one specific (and pretty much guaranteed to be incomplete because its an emulator) implementation of OHCI?sounds wrote:[*]Use VirtualBox's OHCI and QEMU's OHCI implementation, but not the Bochs OHCI implementation
If it's provably broken, report a bug with the project. At any rate, you ought to test real hardware to find out what a proper implementation is up to.
-
- Posts: 3
- Joined: Wed Sep 12, 2012 1:12 pm
Re: Bochs and interrupts (OHCI trouble)
I am not attached to Bochs, but I suspect that _I_ am doing something wrong - not Bochs. Which is why I am asking; have anyone encountered similar problems? I love Bochs, and I have no indication that it is a bug.sounds wrote:How attached are you to bochs?
I suggest you try two approaches, depending on what you feel is more important for your OS:
- Use VirtualBox's OHCI and QEMU's OHCI implementation, but not the Bochs OHCI implementation
- Write a UHCI driver for the Bochs UHCI implementation, and disable the Bochs OHCI implementation in your bochsrc
Re: Bochs and interrupts (OHCI trouble)
As Combuster already mentioned, have you tried it on real hardware, and if so, what was the result? I had some issues on other topics with Bochs too and sometimes it also seems to be that Bochs doesn't emulate everything the way it should.
Grtz,
Bietje
Grtz,
Bietje