Page 1 of 1

VirtualBox guest addons for myos?

Posted: Thu Aug 05, 2010 4:29 am
by Candy
In for example Linux you can install a package of addons that make the screen resolution adjustable and enhance the integration with the host system.

Does anybody know how to do this for your own OS? Has anybody tried this yet? Does anybody know how to address the "video card"?

Re: VirtualBox guest addons for myos?

Posted: Fri Aug 06, 2010 3:17 am
by blobmiester
Does anybody know how to do this for your own OS? Has anybody tried this yet? Does anybody know how to address the "video card"?
All I know about the guest addon features is that it is a PCI card (try enumerating PCI devices and looking at the odd one out :)). I seem to remember someone on these forums working with the device... *comes back from search* can't find the thread right now though.

As for the video card:

Unfortunately, the video card emulated in VirtualBox is a dummy vga-only card (I'm fairly sure). So it's vga only or VESA. There was talk on the virtualbox website of porting the cirrus gd4556 card from qemu (as virtualbox is based off qemu it wouldn't be that hard (tm) was the line of thought) but I don't remember it going anywhere.

Re: VirtualBox guest addons for myos?

Posted: Fri Aug 06, 2010 8:17 am
by JohnnyTheDon
blobmiester wrote:
Does anybody know how to do this for your own OS? Has anybody tried this yet? Does anybody know how to address the "video card"?
All I know about the guest addon features is that it is a PCI card (try enumerating PCI devices and looking at the odd one out :)). I seem to remember someone on these forums working with the device... *comes back from search* can't find the thread right now though.

As for the video card:

Unfortunately, the video card emulated in VirtualBox is a dummy vga-only card (I'm fairly sure). So it's vga only or VESA. There was talk on the virtualbox website of porting the cirrus gd4556 card from qemu (as virtualbox is based off qemu it wouldn't be that hard (tm) was the line of thought) but I don't remember it going anywhere.
VirtualBox supports 3D acceleration, multiple monitors, etc., so there must be some other interface (possibly as part of the guest additions PCI card) that allows one to use all of the graphics features.

Re: VirtualBox guest addons for myos?

Posted: Fri Aug 06, 2010 11:49 am
by blobmiester
I remember reading a list of things the guest additions install did and it included interfacing with the host video card to allow 3D graphics (or something like that).

*searching*

Found the link:

http://www.virtualbox.org/manual/ch04.html#id2623021

Re: VirtualBox guest addons for myos?

Posted: Fri Aug 06, 2010 7:32 pm
by Brynet-Inc
Personally I don't recommend VirtualBox, as it has some emulation problems.. that Sun/Oracle refuse to fix.

But the source for the "addons" does appear to be publicly available, sadly it seems they're one of those annoying projects that are pushing for GPL licensing on DRM/Xorg drivers.

http://www.virtualbox.org/browser/trunk ... /Additions

Re: VirtualBox guest addons for myos?

Posted: Sat Aug 07, 2010 2:37 am
by Candy
Brynet-Inc wrote:Personally I don't recommend VirtualBox, as it has some emulation problems.. that Sun/Oracle refuse to fix.
Got some links for us? Specifically, what kind of emulation problems?

Re: VirtualBox guest addons for myos?

Posted: Mon Aug 09, 2010 9:44 pm
by Brynet-Inc
Candy wrote:
Brynet-Inc wrote:Personally I don't recommend VirtualBox, as it has some emulation problems.. that Sun/Oracle refuse to fix.
Got some links for us? Specifically, what kind of emulation problems?
Sorry, missed your post.

Without hardware virtualization enabled, there is evidence of register corruption, they're not emulating the x86 properly.

http://www.virtualbox.org/ticket/639
http://marc.info/?l=openbsd-misc&m=120492689515501&w=2

Re: VirtualBox guest addons for myos?

Posted: Wed Aug 11, 2010 7:56 am
by Candy
blobmiester wrote:All I know about the guest addon features is that it is a PCI card (try enumerating PCI devices and looking at the odd one out :)).
Looked at it, there's 2 pci devices even. 80EE:BEEF and 80EE:CAFE. CAFE appears to be the guest additions, BEEF is the graphics card.
Unfortunately, the video card emulated in VirtualBox is a dummy vga-only card (I'm fairly sure). So it's vga only or VESA. There was talk on the virtualbox website of porting the cirrus gd4556 card from qemu (as virtualbox is based off qemu it wouldn't be that hard (tm) was the line of thought) but I don't remember it going anywhere.
I looked through the sources in too much detail now and found out that it consists of three main parts for the display driver:

- The functionally unmodified BOCHS display adapter
- An addon that's called VDMA - sounds like direct memory access
- An addon that's called VBGA -> That's the graphics acceleration.

I've looked through the (16k line) sources for the first and it appears to be verbatim Bochs, with a large wrapper and very minor adjustments. That means that you should be able to use your Bochs driver unmodified for VirtualBox.

Re: VirtualBox guest addons for myos?

Posted: Wed Aug 11, 2010 11:52 am
by blobmiester
I looked through the sources in too much detail now and found out that it consists of three main parts for the display driver:

- The functionally unmodified BOCHS display adapter
- An addon that's called VDMA - sounds like direct memory access
- An addon that's called VBGA -> That's the graphics acceleration.

I've looked through the (16k line) sources for the first and it appears to be verbatim Bochs, with a large wrapper and very minor adjustments. That means that you should be able to use your Bochs driver unmodified for VirtualBox.
That's awesome. I guess my source was a bit old. :) I haven't really messed with VirtualBox much yet (don't have it installed) but that would mean that my BGA (BOCHS Graphics Adapter) driver should work unspecialized for BOCHS, QEMU, (and now) VirtualBox (that's 3 major emulators :D)

(meh... not at home so I can't test this)

Re: VirtualBox guest addons for myos?

Posted: Wed Aug 11, 2010 11:26 pm
by Candy
blobmiester wrote:That's awesome. I guess my source was a bit old. :) I haven't really messed with VirtualBox much yet (don't have it installed) but that would mean that my BGA (BOCHS Graphics Adapter) driver should work unspecialized for BOCHS, QEMU, (and now) VirtualBox (that's 3 major emulators :D)
You do need to add the PCI vendor/product ID :-). Their suggested way of testing if you have a specific version of device is writing the IDs that you support in inverse preferred order (most preferred first) to the ID register until you can read one back. I suspect Bochs also supports this, but I don't really see the reason.

They forked at B0C4.

Re: VirtualBox guest addons for myos?

Posted: Thu Aug 12, 2010 3:50 am
by Combuster
Candy wrote:I suspect Bochs also supports this, but I don't really see the reason.
Bochs panics if you try to load an "unsupported" feature ID. You can ignore the panic and it'll still work, but its rather annoying.
It probably has to do with the fact that the video bios should match the implementation of the BGA interface - if you have a too new bios, it will most likely not work and Bochs will rightfully complain about that.

I never found a reason to modify that register though. I did notice that since B0C5, the LFB address isn't fixed anymore. (it's a PCI BAR now)

Re: VirtualBox guest addons for myos?

Posted: Thu Aug 12, 2010 5:13 am
by Candy
Combuster wrote:Bochs panics if you try to load an "unsupported" feature ID. You can ignore the panic and it'll still work, but its rather annoying.
It probably has to do with the fact that the video bios should match the implementation of the BGA interface - if you have a too new bios, it will most likely not work and Bochs will rightfully complain about that.

I never found a reason to modify that register though. I did notice that since B0C5, the LFB address isn't fixed anymore. (it's a PCI BAR now)
That's interesting though. The Vbox code only lists up to B0C4 but it does use BAR0 as framebuffer. I basically assume that if you're running my OS you'll have a fresh enough copy of Bochs so it'll be using a BAR.

Re: VirtualBox guest addons for myos?

Posted: Sun Oct 24, 2010 6:51 pm
by gnomo
Video has worked for me in VirtualBox without any changes in my Bochs Graphics Adaptor Driver. :wink:

Image