OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 10:00 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: What are "VGA-compatible boards and VGA-compatible modes"?
PostPosted: Wed Jul 27, 2022 7:43 am 
Offline
Member
Member

Joined: Tue Jun 07, 2022 11:23 am
Posts: 78
Location: France
I have just switched to VGA graphics mode in 16 bit mode using mov ah, 0x00, mov al, 0x13 and int 0x10. And I went to 32 bit mode.

Now I want to draw stuff on the screen, and I found a documentation saying there is these few methods:
Quote:
  • Use protected-mode code to program the VGA directly, without using the BIOS. This works only with VGA-compatible video boards and VGA-compatible video modes.
  • Add a virtual 8086 mode monitor (VMM) to your OS. Call the BIOS mode-set interrupt in virtual 8086 mode.
  • Switch from pmode to real mode, call the BIOS mode-set interrupt in real mode, then return to pmode.
  • Write a protected-mode driver specifically for the SVGA chip used in your video board. Someone else who wants to use your OS must have the same video board (or they must write a new driver for their own video board).
  • Call VBE 3.x BIOS functions in 16-bit protected mode. Few video cards support VBE 3.x.

I am choosing the first one (cuz it looks like the easiest), so I am wondering what are "VGA-compatible video boards and VGA-compatible video modes"? And am I choosing the best method?


Top
 Profile  
 
 Post subject: Re: What are "VGA-compatible boards and VGA-compatible modes
PostPosted: Wed Jul 27, 2022 9:17 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
If you have switched to a graphics mode using VBE, then you have a framebuffer base address, and you can just write stuff there, whatever the mode of the CPU. That list is more pertaining to switching the video mode after switching to protected or long mode.

VGA-compatible boards would be the original 1987 IBM VGA card and all of its clones. Chances are, if you had one, you would know. And VGA-compatible modes are at most 640x480 with 16 colors at 60Hz. The hardware could not handle more. If you have one of those cards, the register documentation is leaked, so you can just find out the required values to write to the card to make it do whatever you want. However, keep in mind the limitations.

The other options given are for using basically any other card and using VBE to set the video mode. It is mostly enough to just set the video mode in real mode and use the given base address from then on. Bear in mind that nVidia has had a long-standing feud with VBE and deliberately hampered their VBE implementations.

I would start with the above option (use VBE or GOP (on a UEFI computer) to set up a frame buffer and then just use that) until the impossibility to change video modes becomes too annoying, then write a graphics driver for the actual card in my computer. All major manufacturers have at least some documentation available, or else you may peek at open-source drivers. Since I have yet to get to that point, I can offer no advice.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: What are "VGA-compatible boards and VGA-compatible modes
PostPosted: Wed Jul 27, 2022 9:21 am 
Offline
Member
Member

Joined: Tue Jun 07, 2022 11:23 am
Posts: 78
Location: France
Thanks for your advice! I'm also going to use the frame buffer then.

_________________
https://github.com/cheyao/Achieve-Core


Top
 Profile  
 
 Post subject: Re: What are "VGA-compatible boards and VGA-compatible modes
PostPosted: Wed Jul 27, 2022 11:00 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
cyao1234 wrote:
what are "VGA-compatible video boards and VGA-compatible video modes"?

Most display adapters are VGA-compatible. If you can use INT 0x10 to change the video mode, your display adapter is VGA-compatible. VGA-compatible video modes are the ones supported by the original IBM VGA from 1987, which means up to 640x480 and up to 256 colors (but not at the same time).

cyao1234 wrote:
And am I choosing the best method?

The best method is to have your bootloader set up a linear framebuffer. That way, you don't need to worry about VGA compatibility or BIOS/UEFI differences outside your bootloader.


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 62 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