OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 12:49 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Bochs VBE device not present in PCI
PostPosted: Sat Aug 26, 2017 6:38 am 
Offline

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


Top
 Profile  
 
 Post subject: Re: Bochs VBE device not present in PCI
PostPosted: Sat Aug 26, 2017 7:10 am 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2014 9:11 am
Posts: 901
Location: Maadi, Cairo, Egypt
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.


Top
 Profile  
 
 Post subject: Re: Bochs VBE device not present in PCI
PostPosted: Sat Aug 26, 2017 7:39 am 
Offline

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


Top
 Profile  
 
 Post subject: Re: Bochs VBE device not present in PCI
PostPosted: Sat Aug 26, 2017 8:24 am 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2014 9:11 am
Posts: 901
Location: Maadi, Cairo, Egypt
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.


Top
 Profile  
 
 Post subject: Re: Bochs VBE device not present in PCI
PostPosted: Sat Aug 26, 2017 8:42 am 
Offline

Joined: Sun Jul 16, 2017 4:22 am
Posts: 16
That explains a lot :)

Thanks so much!


Top
 Profile  
 
 Post subject: Re: Bochs VBE device not present in PCI
PostPosted: Sat Aug 26, 2017 9:07 am 
Offline

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


Top
 Profile  
 
 Post subject: Re: Bochs VBE device not present in PCI
PostPosted: Sat Aug 26, 2017 4:20 pm 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2014 9:11 am
Posts: 901
Location: Maadi, Cairo, Egypt
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 103 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group