Bochs VBE device not present in PCI

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
dborowiec10
Posts: 16
Joined: Sun Jul 16, 2017 4:22 am

Bochs VBE device not present in PCI

Post by dborowiec10 »

Hello,

I am trying to set up my kernel to work with bochs VBE extension.

I have all the correct configuration in the script such as:
vgaromimage: .../VGABIOS-lgpl-latest
vga: extension=vbe

From what I understand, a device on PCI should appear with the following:
vendor_id: 0x1111, device id: 0x1234
I could then grab BAR0 and get the correct linear framebuffer address.

This works well when I run my kernel in qemu but in bochs, it does not appear.
Interestingly, when I start playing about with setting vbe resolutions and modes they all seem to be working
and the display changes its size.
It must be a bochs specific setting that Im missing or something along those lines.

Could someone point me in the right direction here?

Thanks!
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: Bochs VBE device not present in PCI

Post by BrightLight »

There are two types of BGA: PCI and ISA. For PCI, you read the framebuffer base address from BAR0, like you said. For ISA, it is hard-coded at physical address 0xE0000000.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
dborowiec10
Posts: 16
Joined: Sun Jul 16, 2017 4:22 am

Re: Bochs VBE device not present in PCI

Post by dborowiec10 »

Oh ok.
Can you just confirm that this is the case with bochs?
Is bochs' BGA an ISA one?
Is this why qemu lists it on PCI?
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: Bochs VBE device not present in PCI

Post by BrightLight »

Bochs uses ISA BGA by default, but you can configure it to use a PCI BGA if you want. Of course, I don't recall the configuration options, but a quick Google search will get you decent results. QEMU uses PCI BGA when you pass option "-vga std", and by default in some builds, including the one from Ubuntu's repository.

To check the existence of BGA at all, you should use the I/O ports. Specifically, you should read the BGA version register (index 0) and make sure it contains a value in the range of 0xB0C0 to 0xB0C5, inclusive. If the BGA exists, then you can determine it is a PCI or ISA BGA by scanning the PCI devices.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
dborowiec10
Posts: 16
Joined: Sun Jul 16, 2017 4:22 am

Re: Bochs VBE device not present in PCI

Post by dborowiec10 »

That explains a lot :)

Thanks so much!
dborowiec10
Posts: 16
Joined: Sun Jul 16, 2017 4:22 am

Re: Bochs VBE device not present in PCI

Post by dborowiec10 »

Btw
My searching abilities are clearly lacking :D

After a bit more thourough googling I found this: http://forum.osdev.org/viewtopic.php?f=1&p=227076
Clearly explains what you just told me.
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: Bochs VBE device not present in PCI

Post by BrightLight »

dborowiec10 wrote:My searching abilities are clearly lacking :D
Take that into consideration next time, instead of asking answered questions. ;)
You know your OS is advanced when you stop using the Intel programming guide as a reference.
Post Reply