GRUB won't set video mode above 640x480x32 [Solved]

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
codyd51
Member
Member
Posts: 77
Joined: Fri May 20, 2016 2:29 pm
Location: London, UK
GitHub: https://github.com/codyd51
Contact:

GRUB won't set video mode above 640x480x32 [Solved]

Post by codyd51 »

Hello,

I'm trying to use GRUB to set a video mode instead of querying available modes myself. This is my multiboot header:

Code: Select all

mboot:
	dd MBOOT_HEADER_MAGIC	; header value for GRUB
	dd MBOOT_HEADER_FLAGS	; grub settings
	dd MBOOT_CHECKSUM	; ensure above values are correct

	dd 0 ; these flags are unused
	dd 0
	dd 0
	dd 0
	dd 0 

	dd 0 ; set video mode
	;1024 x 768 x 24
	dw 1024
	dw 768
	dw 24
No matter what resolution/bpp I set there, GRUB always sets 640x480x32. I'm running my OS in QEMU.

Has anyone encountered a similar issue?
Last edited by codyd51 on Wed Jan 18, 2017 2:54 pm, edited 1 time in total.
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: GRUB won't set video mode above 640x480x32

Post by glauxosdever »

Hi,


If GRUB can't find a video mode of the specified properties, it will set whatever best it can find.

It would be useful to also provide the qemu command.

Hope this helps. :-)


Regards,
glauxosdever
User avatar
matt11235
Member
Member
Posts: 286
Joined: Tue Aug 02, 2016 1:52 pm
Location: East Riding of Yorkshire, UK

Re: GRUB won't set video mode above 640x480x32

Post by matt11235 »

What do you have for MBOOT_HEADER_FLAGS? I think that you need to set the second bit to 1.
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
hannah
Member
Member
Posts: 34
Joined: Wed Oct 12, 2016 11:32 am
Location: At my PC

Re: GRUB won't set video mode above 640x480x32

Post by hannah »

Try putting -vga std on your QEMU command line.
codyd51
Member
Member
Posts: 77
Joined: Fri May 20, 2016 2:29 pm
Location: London, UK
GitHub: https://github.com/codyd51
Contact:

Re: GRUB won't set video mode above 640x480x32

Post by codyd51 »

These are my multiboot flags:

Code: Select all

MBOOT_PAGE_ALIGN	equ 1<<0	; load kernel and modules on page boundary
MBOOT_MEM_INFO		equ 1<<1	; provide kernel. with memory info
MBOOT_VBE_MODE		equ 1<<2	; have GRUB set video mode
MBOOT_HEADER_MAGIC	equ 0x1BADB002	; multiboot magic value
MBOOT_HEADER_FLAGS	equ MBOOT_PAGE_ALIGN | MBOOT_MEM_INFO | MBOOT_VBE_MODE
MBOOT_CHECKSUM		equ -(MBOOT_HEADER_MAGIC + MBOOT_HEADER_FLAGS)
And this is the command I'm using to launch QEMU:

Code: Select all

	$(EMULATOR) -vga std -net nic,model=ne2k_pci -d cpu_reset -D qemu.log -serial file:syslog.log -cdrom $^
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: GRUB won't set video mode above 640x480x32

Post by Kazinsal »

The mode parameters in the header should be stored as dd (32 bits), not dw (16 bits).
codyd51
Member
Member
Posts: 77
Joined: Fri May 20, 2016 2:29 pm
Location: London, UK
GitHub: https://github.com/codyd51
Contact:

Re: GRUB won't set video mode above 640x480x32

Post by codyd51 »

Kazinsal wrote:The mode parameters in the header should be stored as dd (32 bits), not dw (16 bits).
Whoops! That's a goof. Thanks a lot! That solved the issue.
Post Reply