Page 2 of 2
Re: VESA without BIOS
Posted: Mon Oct 19, 2020 3:21 am
by bloodline
mallard wrote:
Slight nitpick; that game actually runs at 640x
400, allowing it to double-buffer within the standard 256KB VGA memory, which certainly affects (perceived) performance.
I've
previously posted the available options for "better-than-VGA" graphics in protected mode. Personally, I use the x86 emulator route (via the excellent designed-for-exactly-this-purpose libx86emu).
Probably redundant idea now, but did anyone ever "wrap up" libx86emu in to a c library that could be used as a basic VBE graphics driver?
I've spent days fighting with GRUB2, and getting nowhere... I think I'm going to have to bite the bullet, move into the21st century and get my kernel booting via EFI if I want graphics
Re: VESA without BIOS
Posted: Mon Oct 19, 2020 3:58 am
by crosssans
bloodline wrote:
I've spent days fighting with GRUB2, and getting nowhere... I think I'm going to have to bite the bullet, move into the21st century and get my kernel booting via EFI if I want graphics
With GRUB2, you can set an initial VESA video mode in two ways:
- By setting `gfxpayload` to a known supported resolution (such as `800x600x32`) in your `grub.cfg` file; though I consider this more as a hack rather than a proper solution but it can still be used for early kernel development. Here is an example:
Code: Select all
menuentry 'MyOS' {
load_video
set gfxpayload=800x600x32
multiboot2 /path/to/kernel.elf
boot arg_a arg_b...
}
Note that although you specified a given resolution, this doesn't mean the actual boot manager will always set the video mode to the requested resolution (especially if they're non-standard). You got to also check the presence of the `framebuffer-info` tag in the given taglist (see EFI i386 machine state with boot services enabled) to ensure that the boot loader did the actual work of setting a video mode in addition of receiving the actual framebuffer address & video mode properties.
- By specifing a `framebuffer` tag to your Multiboot 2 compliant kernel header. Has the advantage of being handled by all Multiboot 2 compliant boot managers. Just like the first method, you will need to check the presence & the contents of the `framebuffer-info` tag to be sure that the boot manager has set the correct resolution
Re: VESA without BIOS
Posted: Mon Oct 19, 2020 4:40 am
by bloodline
crosssans wrote:bloodline wrote:
I've spent days fighting with GRUB2, and getting nowhere... I think I'm going to have to bite the bullet, move into the21st century and get my kernel booting via EFI if I want graphics
With GRUB2, you can set an initial VESA video mode in two ways:
- By setting `gfxpayload` to a known supported resolution (such as `800x600x32`) in your `grub.cfg` file; though I consider this more as a hack rather than a proper solution but it can still be used for early kernel development. Here is an example:
Code: Select all
menuentry 'MyOS' {
load_video
set gfxpayload=800x600x32
multiboot2 /path/to/kernel.elf
boot arg_a arg_b...
}
Note that although you specified a given resolution, this doesn't mean the actual boot manager will always set the video mode to the requested resolution (especially if they're non-standard). You got to also check the presence of the `framebuffer-info` tag in the given taglist (see EFI i386 machine state with boot services enabled) to ensure that the boot loader did the actual work of setting a video mode in addition of receiving the actual framebuffer address & video mode properties.
- By specifing a `framebuffer` tag to your Multiboot 2 compliant kernel header. Has the advantage of being handled by all Multiboot 2 compliant boot managers. Just like the first method, you will need to check the presence & the contents of the `framebuffer-info` tag to be sure that the boot manager has set the correct resolution
Thanks for this, I am quite familiar with GRUB Legacy (used it around 15 to 20 years ago ), so that is what I have been using, but for some reason I can't get the version (0.92?) I'm using to set a frame buffer... I figured it's just too old, so I'm trying to install GRUB 2 but it keeps throwing me to the Rescue shell...
It's entirely my fault, I'm sure I'm getting the install parameters wrong, the grub documentation is abysmal...
Re: VESA without BIOS
Posted: Mon Oct 19, 2020 6:54 am
by bloodline
Ok, so it is my grub2 config that is at fault... I booted my with Debian image, and then at the grub command line I typed:
grub> multiboot (hd1,msdos1)/kernel.elf
grub>boot
And my framebuffer test pattern was displayed!!! Now I need to figure out how to get my grub2 config right... the Debian grub-mkconfig script just keeps wanting to set up linux
My Kernel disk image just keeps failing with:
error: no such device: blah blah blah blah some random uuid
-EDIT- Ok... got there in the end... I now have it booting to a 800x600x16 display... time to write a proper gfx library!