VGA: only part of screen

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.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: VGA: only part of screen

Post by Brendan »

Hi,
Awe2K wrote:Ok, now I've got my mboot->vbe_mode bit 14 set, how do I know linear address then, or where are framebuffer segments located?
GRUB/multi-boot just gives you the same data it got from VBE. More specifically, you're looking for the "VBE mode information structure" defined by VESA. A pointer to this is given to you in multi-boot's "boot information structure".

You can find more information about VBE (and the "VBE mode information structure") here; especially links to the VBE specification itself near the bottom of that page.

I'd highly recommend reading that VBE specification; because you're going to need to know a whole bunch of stuff about pixel formats/masks/shifts, addressing, "bytes between lines", etc.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Awe2K
Member
Member
Posts: 49
Joined: Sat Oct 24, 2015 3:14 am
Libera.chat IRC: awe2k

Re: VGA: only part of screen

Post by Awe2K »

Brendan wrote:Hi,
Awe2K wrote:Ok, now I've got my mboot->vbe_mode bit 14 set, how do I know linear address then, or where are framebuffer segments located?
GRUB/multi-boot just gives you the same data it got from VBE. More specifically, you're looking for the "VBE mode information structure" defined by VESA. A pointer to this is given to you in multi-boot's "boot information structure".

You can find more information about VBE (and the "VBE mode information structure") here; especially links to the VBE specification itself near the bottom of that page.

I'd highly recommend reading that VBE specification; because you're going to need to know a whole bunch of stuff about pixel formats/masks/shifts, addressing, "bytes between lines", etc.


Cheers,

Brendan
Thanks, I've already retrieved that struct from grub (mboot->vbe_mode_info). Graphics seem to work now :)
Attachments
scr.png
freecrac
Member
Member
Posts: 69
Joined: Thu Sep 20, 2012 5:11 am
Location: germany hamburg

Re: VGA: only part of screen

Post by freecrac »

Hello.
Brendan wrote: You can find more information about VBE (and the "VBE mode information structure") here; especially links to the VBE specification itself near the bottom of that page.
I am not sure if it is possible with Grub to use refreshrate controlled videomodes with a VBE 3 bios.

For refreshrate controlled videomodes it is usefull to get the monitor information for to check the capacity of the monitor.
Example for 800x600@140 hz refreshrate i use a monitor with 96 khz like most of the 19" CRTs support.

The original and costfree documents can be found on vesa.org(need register/login) in their public section:
"vbe3.pdf"
"EEDIDguideV1.pdf"
"EEDIDverifGuideRa.pdf"

Dirk
Awe2K
Member
Member
Posts: 49
Joined: Sat Oct 24, 2015 3:14 am
Libera.chat IRC: awe2k

Re: VGA: only part of screen

Post by Awe2K »

Damn it. Grub still tries to kill my kernel.
When I try to load ramdisk, it just trashes screen.
There's no problem if I boot it without ramdisk in grub.cfg

Code: Select all

menuentry "myos" {
	multiboot /boot/kernel.bin
	module /boot/initrd.gz
}
Attachments
Untitled.png
Awe2K
Member
Member
Posts: 49
Joined: Sat Oct 24, 2015 3:14 am
Libera.chat IRC: awe2k

Re: VGA: only part of screen

Post by Awe2K »

Okay, I've fixed that. Now GRUB gives me correct pointer to vbe mode info.
(1024x768x24bpp, it even tells me pitch :) )
Attachments
sc.png
Post Reply