Different output from 3 different VMs plus real hardware?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Caleb1994
Member
Member
Posts: 83
Joined: Sun Feb 13, 2011 4:55 pm

Different output from 3 different VMs plus real hardware?

Post by Caleb1994 »

I had PCI bus enumeration working (so I thought), and so I went to try it on real hardware (just wanted to see the full list of real PCI devices), and it triple faults! I thought, well that's odd, because I saw the blue lines (I'm printing the PCI devices that I found in blue) fly by right before it triple faulted, and the only thing after that is my one and only task sleeps (indefinitely) and the PC just keeps running the Idle thread forever (I know not good, but it's just temporary).

Now, I had no idea why it was triple faulting, so I thought I'd try it in Bochs 1. to see if it triple faults, and bochs gives me some useful info, and 2. see if there are any warnings printed by bochs. Well Yes, and No. Bochs didn't say anything was wrong (no triple fault), but I only got one device, and it wasn't valid. (I was manually setting up the Host Bridge at Bus:0,Device:0,Function:0 without checking validity since it's supposed to always be there). So while I didn't triple fault, something is either wrong with my bochs config, or still the same (really odd) error.

After that, I tried to run it in VirtualBox just to see what it did (since I had speratic behavior up to this point). I got a good list of devices (actually more devices then Qemu gave me!) granted some said "Unknown PCI device" but that's probably because I haven't finished my pci_classcode.h file (there's A LOT of classes to manually type :( ).

So lets go back over that.

Machine 1: Qemu, works
Machine 2: Physical, triple faults
Machine 3: Bochs, works with bad PCI list
Machine 4: VirtualBox, works

Any ideas? I have no idea even where to start looking! Lol I attached two screenshots. One of qemu, and one of bochs output (couldn't get one of physical, and virtualbox is basically the same as qemu).
Attachments
Bochs output
Bochs output
Qemu output
Qemu output
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Different output from 3 different VMs plus real hardware

Post by Brendan »

Hi,
Caleb1994 wrote:So lets go back over that.

Machine 1: Qemu, works
I don't think so. For the last device, I have never seen any device that could be described as a "PCI RAM controller" including by Qemu, and the Vendor ID isn't valid (according to pcidatabase.com). I'd assume this last device is wrong.
Caleb1994 wrote:Machine 2: Physical, triple faults
Can you put a endless loop (with interrupts disabled) just after the PCI detection code; to see if the triple fault occurs during PCI enumeration or if it happens afterwards in something else?
Caleb1994 wrote:Any ideas?
I'd assume there's one or more bugs somewhere...
Caleb1994 wrote:I have no idea even where to start looking!
If you've got full access to all of the source code and have no idea, just imagine what it must be like for people who can only see 2 screenshots!


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Different output from 3 different VMs plus real hardware

Post by gerryg400 »

To be honest I wouldn't be worried about PCI detection right now. If I were getting a triple-fault I would be wondering why my kernel/trap-handlers/whatever are allowing that to happen.
If a trainstation is where trains stop, what is a workstation ?
Post Reply