Page 1 of 1

multiboot2 and EGA textmode

Posted: Tue Dec 26, 2023 3:19 pm
by mrjbom
Hi. I'm trying to boot into EGA text mode (because it's more convenient for debugging now, but I'll switch to VGA in the future) using multiboot2, but GRUB loads me into VGA mode.
This is what my framebuffer tag looks like.

Code: Select all

dw 5  ; type
dw 0  ; flags: it is not optional tag
dd 20 ; size
dd 80 ; width
dd 25 ; height
dd 0   ; depth: text mode
I know that this is just a recommendation and GRUB is not obliged to follow this tag, however, multiboot1 successfully loaded me in textmode, so I expect this from multiboot2 as well. I use qemu for emulation.
It looks like I'm missing something and I should specify the text mode somewhere, but where?

Re: multiboot2 and EGA textmode

Posted: Tue Dec 26, 2023 3:36 pm
by Octocontrabass
mrjbom wrote:GRUB loads me into VGA mode.
Which VGA mode? Or did you actually mean GRUB sets up a linear framebuffer?

The presence of a framebuffer tag implies framebuffer support. Try removing the framebuffer tag and using a flags tag to indicate EGA text mode support.

Re: multiboot2 and EGA textmode

Posted: Tue Dec 26, 2023 3:55 pm
by mrjbom
Octocontrabass wrote:
mrjbom wrote:GRUB loads me into VGA mode.
Try removing the framebuffer tag and using a flags tag to indicate EGA text mode support.
In Flags tag, I set console_flags to 10b, bit 1 is set, which means that the OS supports EGA textmode, but the OS still does not load in text mode. If I now delete the framebuffer tag, then how can I specify the width and height in text mode?

I tried deleting the framebuffer tag and booted into text mode.
But how do I specify the parameters of the text mode?
The specification says that for the text mode, the fields in the framebuffer tag control the height and width of the text mode, but if the presence of this tag turns on the framebuffer mode, then how do I configure the text mode?

Re: multiboot2 and EGA textmode

Posted: Tue Dec 26, 2023 7:36 pm
by Octocontrabass
I don't think GRUB can configure the text mode.

If you want to use text mode without removing the framebuffer tag, you can add "set gfxpayload=text" to your grub.cfg.

Re: multiboot2 and EGA textmode

Posted: Wed Dec 27, 2023 6:26 pm
by mrjbom
Octocontrabass wrote:If you want to use text mode without removing the framebuffer tag, you can add "set gfxpayload=text" to your grub.cfg.
This is what I needed, thanks for the answer!