Page 2 of 2
Re: How to enter graphics mode?
Posted: Tue Jul 14, 2015 3:17 am
by Combuster
If you insist on not using the firmware,
your pilgrimage starts here. Expect nobody to be able answer your questions past this point if you do.
Re: How to enter graphics mode?
Posted: Tue Jul 14, 2015 3:20 am
by reload
Ok, I see I can do this well only with BIOS, right?
Re: How to enter graphics mode?
Posted: Tue Jul 14, 2015 3:47 am
by Roman
reload wrote:Ok, I see I can do this well only with BIOS, right?
Define "well". VESA BIOS extensions are old and obsolete interfaces to the graphics card. It is the fastest and easiest way to get to the graphics, but fastest != best. You should use VBE as a fallback and then try to write some card-specific drivers. I suggest you to begin with an older and simpler GPU or try to understand Linux code, if you really want Nvidia (because Nvidia doesn't provide any documentation, unfortunately).
Re: How to enter graphics mode?
Posted: Tue Jul 14, 2015 3:52 am
by Roman
Combuster wrote:If you insist on not using the firmware,
your pilgrimage starts here. Expect nobody to be able answer your questions past this point if you do.
Shouldn't he also consider looking at drivers/gpu/drm/nouveau? Or it's not necessary?
Re: How to enter graphics mode?
Posted: Tue Jul 14, 2015 5:21 am
by Combuster
If you read the exact wording, you'll notice that question is already answered.
Re: How to enter graphics mode?
Posted: Tue Jul 14, 2015 7:25 am
by Unsigned
reload wrote:Ok, I see I can do this well only with BIOS, right?
It is possible to write directly to the VGA registers, but there are some things to consider:
- The graphics adapter must be VGA-compatible.
- The graphics adapter must be in a VGA-compatible mode, that's to say, card-specific registers must not be currently taken into account and VGA registers must be taken into account by the adapter so that you can actually change the video mode by modifying them.
- The maximum resolution will be 720*480 pixels, with only 16 colors.
- There will be only 256KB of video memory, so you can get 2 video pages with a resolution of 640*400, but you'll get only 1 video page with higher resolutions.
- Memory addressing will be bit-planar, but this shouldn't be a big problem once you write routines to update parts of the screen from your software framebuffer.
If you still want to use this lower resolution graphics mode, see
this post. You can set a VGA graphics mode with this code.
Anyway, you should use v86 mode, not only for VESA, but also in case you want to add DOS compatibility to your OS, or for supporting more BIOS interrupts.
Re: How to enter graphics mode?
Posted: Tue Jul 14, 2015 7:40 am
by Combuster
Unsigned wrote:Anyway, you should use v86 mode, not only for VESA, but also in case you want to add DOS compatibility to your OS, or for supporting more BIOS interrupts.
Now there's a really bad idea.
Video BIOS interrupts already assume control over the entire video card and on several occasions more than that. Other BIOS interrupts assume control over the
entire computer. Going along with the former is doable, but you already interfered with the latter if you've got any decent protected mode setup, and you're just begging for the system to halt and catch fire if you try any interrupt other than int 0x10.
Re: How to enter graphics mode?
Posted: Tue Jul 14, 2015 8:08 am
by Unsigned
Yes, that's true.
I just said that as a suggestion, but in reality there's no need to use the other BIOS interrupts like, say, Plug and Play. It's better to write drivers for that.
As far as I can remember, the VESA specification says VBE functions should be given access to the PCI configuration registers. And since they don't provide information about the ports the card needs, the v86 task should be given access to any port belonging to detected graphics adapters, as well as ports belonging to non-detected (non-Plug and Play) graphics adapters too. So basically, to be sure it will work, the v86 task would be given access to all the ports, except those ones which belong to detected, non-graphics devices.