multiboot2 and EGA textmode

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.
Post Reply
User avatar
mrjbom
Member
Member
Posts: 300
Joined: Sun Jul 21, 2019 7:34 am

multiboot2 and EGA textmode

Post 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?
Octocontrabass
Member
Member
Posts: 5218
Joined: Mon Mar 25, 2013 7:01 pm

Re: multiboot2 and EGA textmode

Post 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.
User avatar
mrjbom
Member
Member
Posts: 300
Joined: Sun Jul 21, 2019 7:34 am

Re: multiboot2 and EGA textmode

Post 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?
Octocontrabass
Member
Member
Posts: 5218
Joined: Mon Mar 25, 2013 7:01 pm

Re: multiboot2 and EGA textmode

Post 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.
User avatar
mrjbom
Member
Member
Posts: 300
Joined: Sun Jul 21, 2019 7:34 am

Re: multiboot2 and EGA textmode

Post 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!
Post Reply