Hello all!
I currently passing my desired resolution (and bbp) to grub with the multiboot header flags. I can read the graphics pointer and draw graphics on the screen.
My question is, how do I ask grub to set the graphics mode to the maximum resolution of the monitor, at specifically 32 bbp, instead of passing it a resolution?
Thanks in advance!
Setting graphics mode to maximum resolution
Re: Setting graphics mode to maximum resolution
Try the line:
GRUB_GFXMODE=auto
in your configuration file. Note that Grub can only set modes supported by VBE.
GRUB_GFXMODE=auto
in your configuration file. Note that Grub can only set modes supported by VBE.
Re: Setting graphics mode to maximum resolution
Hi,
You really want to use EDID to ensure that the video mode is supported by both the video card and the monitor. UEFI does this (or at least it's supposed to) so it shouldn't be a problem for "GRUB on UEFI"; but the BIOS doesn't (and as far as I know GRUB doesn't either) so it will be a disaster for "GRUB on BIOS".
Also note that what you really want is the monitor's native resolution, not the maximum resolution that the monitor can down-scale and make blurry.
Cheers,
Brendan
Note that just because VBE and the video card support a video mode it doesn't mean that the monitor itself supports that video mode. In practice, this means "set graphics mode to max. supported by VBE" is the same as "maximise the possibility that the user will see nothing".iansjack wrote:Note that Grub can only set modes supported by VBE.
You really want to use EDID to ensure that the video mode is supported by both the video card and the monitor. UEFI does this (or at least it's supposed to) so it shouldn't be a problem for "GRUB on UEFI"; but the BIOS doesn't (and as far as I know GRUB doesn't either) so it will be a disaster for "GRUB on BIOS".
Also note that what you really want is the monitor's native resolution, not the maximum resolution that the monitor can down-scale and make blurry.
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.
- obiwac
- Member
- Posts: 149
- Joined: Fri Jan 27, 2017 12:15 pm
- Libera.chat IRC: obiwac
- Location: Belgium
Re: Setting graphics mode to maximum resolution
Ok thanks. I'll do a bit more research then.
-
- Member
- Posts: 1146
- Joined: Sat Mar 01, 2014 2:59 pm
Re: Setting graphics mode to maximum resolution
You'll want to start with figuring out how to set the graphics mode yourself. Then you'll need to find out how to get the maximum and preferred resolutions of the graphics card and monitor, and use this to choose a suitable resolution. Think also about how you're going to handle changing the resolution during operation (if at all) - the user might want to change the resolution without having to reboot the computer, such as when they connect another monitor or if your OS chooses the wrong resolution and they want to change it.obiwac wrote:Ok thanks. I'll do a bit more research then.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
- eryjus
- Member
- Posts: 286
- Joined: Fri Oct 21, 2011 9:47 pm
- Libera.chat IRC: eryjus
- Location: Tustin, CA USA
Re: Setting graphics mode to maximum resolution
I started down this path myself last week. Ultimately I chose to have my stage 3 loader support only 1024x768 while it is collecting info for the kernel and setting the CPU in native mode. The resolution is pretty ubiquitous still even if it letter boxed. As onlyonemac says, I made the choice to support the final resolution later in the OS driver.obiwac wrote:Hello all!
I currently passing my desired resolution (and bbp) to grub with the multiboot header flags. I can read the graphics pointer and draw graphics on the screen.
My question is, how do I ask grub to set the graphics mode to the maximum resolution of the monitor, at specifically 32 bbp, instead of passing it a resolution?
Thanks in advance!
Adam
The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal
"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber
The name is fitting: Century Hobby OS -- At this rate, it's gonna take me that long!
Read about my mistakes and missteps with this iteration: Journal
"Sometimes things just don't make sense until you figure them out." -- Phil Stahlheber
Re: Setting graphics mode to maximum resolution
GRUB reads EDID and sets the mode that is specified by the first detailed timing descriptor (in grub_video_edid_preferred_mode()).Brendan wrote:You really want to use EDID to ensure that the video mode is supported by both the video card and the monitor. UEFI does this (or at least it's supposed to) so it shouldn't be a problem for "GRUB on UEFI"; but the BIOS doesn't (and as far as I know GRUB doesn't either) so it will be a disaster for "GRUB on BIOS".
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
- obiwac
- Member
- Posts: 149
- Joined: Fri Jan 27, 2017 12:15 pm
- Libera.chat IRC: obiwac
- Location: Belgium
Re: Setting graphics mode to maximum resolution
I think I won't try to go with something too complicated. I think that for now I'ts ok if the computer has to reboot. I timed it once, and it was like 15 seconds or something. Thanks!onlyonemac wrote:You'll want to start with figuring out how to set the graphics mode yourself. Then you'll need to find out how to get the maximum and preferred resolutions of the graphics card and monitor, and use this to choose a suitable resolution. Think also about how you're going to handle changing the resolution during operation (if at all) - the user might want to change the resolution without having to reboot the computer, such as when they connect another monitor or if your OS chooses the wrong resolution and they want to change it.obiwac wrote:Ok thanks. I'll do a bit more research then.