GRUB multiboot not using requested VGA text mode resolution?
Posted: Mon May 13, 2024 3:53 am
Hello all.
I've been working on a super basic C microkernel that operates in VGA text mode. It uses GRUB as the bootloader and is multiboot compliant.
I read through the multiboot specification and saw an section about how to set flags (e.g. screen resolution) and I noticed that you can request a change from the default 80x25 width and height in VGA text mode. I tried this, requesting a different width and height, but GRUB didn't make the changes.
I tried playing around with the flags a bit, and I know that GRUB is seeing those flags and they're in the right place because when I changed the video mode bit to 0, it successfully switched to VGA graphics mode.
I know that the multiboot spec says that it's just a suggestion, and the bootloader may ignore it as it sees fit, but I've seen other multiboot OSs launched from GRUB change the VGA text resolution on the same machine I'm testing on.
Is there some GRUB-specific thing that I'm missing here? I've scoured the internet but haven't been able to come up with anything.
Here's the beginning of my asm entrypoint:
The above code, regardless of the width and height I set, boots into the standard 80x25. I've tried all kinds of different resolutions, both common and uncommon ones, but to no avail. Am I doing something wrong here?
I've been working on a super basic C microkernel that operates in VGA text mode. It uses GRUB as the bootloader and is multiboot compliant.
I read through the multiboot specification and saw an section about how to set flags (e.g. screen resolution) and I noticed that you can request a change from the default 80x25 width and height in VGA text mode. I tried this, requesting a different width and height, but GRUB didn't make the changes.
I tried playing around with the flags a bit, and I know that GRUB is seeing those flags and they're in the right place because when I changed the video mode bit to 0, it successfully switched to VGA graphics mode.
I know that the multiboot spec says that it's just a suggestion, and the bootloader may ignore it as it sees fit, but I've seen other multiboot OSs launched from GRUB change the VGA text resolution on the same machine I'm testing on.
Is there some GRUB-specific thing that I'm missing here? I've scoured the internet but haven't been able to come up with anything.
Here's the beginning of my asm entrypoint:
Code: Select all
; Multiboot header
FLAGS equ 0b00000111
MAGIC equ 0x1BADB002
CHECKSUM equ -(MAGIC + FLAGS) ; checksum + (flags + magic) should be 0
section .multiboot
align 4
dd MAGIC
dd FLAGS
dd CHECKSUM
; padding to make it 16 bytes long
times 5 dd 0
; video output flags
dd 1 ; type (1 = text mode)
dd 81 ; width (1 extra character for testing)
dd 25 ; height
dd 0 ; depth, always 0 in text mode