VESA without BIOS

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
bloodline
Member
Member
Posts: 264
Joined: Tue Sep 15, 2020 8:07 am
Location: London, UK

Re: VESA without BIOS

Post by bloodline »

mallard wrote:
bzt wrote:It is not. See The Incredible Machine for example.
Slight nitpick; that game actually runs at 640x400, 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 :roll:
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
User avatar
crosssans
Member
Member
Posts: 39
Joined: Fri Mar 01, 2019 3:50 pm
Location: France

Re: VESA without BIOS

Post 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 :roll:
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
User avatar
bloodline
Member
Member
Posts: 264
Joined: Tue Sep 15, 2020 8:07 am
Location: London, UK

Re: VESA without BIOS

Post 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 :roll:
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...
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
User avatar
bloodline
Member
Member
Posts: 264
Joined: Tue Sep 15, 2020 8:07 am
Location: London, UK

Re: VESA without BIOS

Post 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 :roll:

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!
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
Post Reply