VirtualBox guest addons for myos?

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
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

VirtualBox guest addons for myos?

Post 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"?
User avatar
blobmiester
Member
Member
Posts: 45
Joined: Fri Jul 16, 2010 9:49 am

Re: VirtualBox guest addons for myos?

Post 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.
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: VirtualBox guest addons for myos?

Post 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.
User avatar
blobmiester
Member
Member
Posts: 45
Joined: Fri Jul 16, 2010 9:49 am

Re: VirtualBox guest addons for myos?

Post 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
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: VirtualBox guest addons for myos?

Post 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
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: VirtualBox guest addons for myos?

Post 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?
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: VirtualBox guest addons for myos?

Post 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
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: VirtualBox guest addons for myos?

Post 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.
User avatar
blobmiester
Member
Member
Posts: 45
Joined: Fri Jul 16, 2010 9:49 am

Re: VirtualBox guest addons for myos?

Post 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)
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: VirtualBox guest addons for myos?

Post 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.
User avatar
Combuster
Member
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: VirtualBox guest addons for myos?

Post 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)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re: VirtualBox guest addons for myos?

Post 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.
gnomo
Posts: 1
Joined: Mon Mar 05, 2007 6:25 am

Re: VirtualBox guest addons for myos?

Post by gnomo »

Video has worked for me in VirtualBox without any changes in my Bochs Graphics Adaptor Driver. :wink:

Image
Post Reply