I have a correctly configured multiboot C os.
GRUB2 sets the VBE mode on Boot, and i get the LFB adress from multiboot header, and set the pixels

I say to grub "just set this vbe mode" with this code in bootstrap assembly:
MBALIGN equ 1<<0
MEMINFO equ 1<<1
VIDINFO equ 1<<2
FLAGS equ MBALIGN | MEMINFO | VIDINFO
MAGIC equ 0x1BADB002
CHECKSUM equ -(MAGIC + FLAGS)
section .multiboot
align 4
dd MAGIC
dd FLAGS
dd CHECKSUM
dd 0, 0, 0, 0, 0
dd 0
dd 1024, 768, 32
Yes, it is working great but, this resolution can be don't supported on some monitors, and this resolution can be really small than monitor's best highest resolution...
How can i set this resolution automaticly as the greatest and highest resolution and depth mode?
Thanks

Oh and i forgot, my grub config is:
menuentry "TestOS" {
multiboot /boot/OS.bin
}
And I'm using Grub2, not patched legacy grub.
@catnikita255, do you have a knowledge about it?