OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 11:41 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: GRUB won't set video mode above 640x480x32 [Solved]
PostPosted: Wed Jan 18, 2017 11:45 am 
Offline
Member
Member

Joined: Fri May 20, 2016 2:29 pm
Posts: 77
Location: Paris, France
Hello,

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

Code:
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?

_________________
www.github.com/codyd51/axle.git


Last edited by codyd51 on Wed Jan 18, 2017 2:54 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: GRUB won't set video mode above 640x480x32
PostPosted: Wed Jan 18, 2017 12:18 pm 
Offline
Member
Member

Joined: Wed Jun 17, 2015 9:40 am
Posts: 501
Location: Athens, Greece
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


Top
 Profile  
 
 Post subject: Re: GRUB won't set video mode above 640x480x32
PostPosted: Wed Jan 18, 2017 12:19 pm 
Offline
Member
Member
User avatar

Joined: Tue Aug 02, 2016 1:52 pm
Posts: 286
Location: East Riding of Yorkshire, UK
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


Top
 Profile  
 
 Post subject: Re: GRUB won't set video mode above 640x480x32
PostPosted: Wed Jan 18, 2017 12:33 pm 
Offline
Member
Member

Joined: Wed Oct 12, 2016 11:32 am
Posts: 34
Location: At my PC
Try putting -vga std on your QEMU command line.


Top
 Profile  
 
 Post subject: Re: GRUB won't set video mode above 640x480x32
PostPosted: Wed Jan 18, 2017 1:01 pm 
Offline
Member
Member

Joined: Fri May 20, 2016 2:29 pm
Posts: 77
Location: Paris, France
These are my multiboot flags:

Code:
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:
   $(EMULATOR) -vga std -net nic,model=ne2k_pci -d cpu_reset -D qemu.log -serial file:syslog.log -cdrom $^

_________________
www.github.com/codyd51/axle.git


Top
 Profile  
 
 Post subject: Re: GRUB won't set video mode above 640x480x32
PostPosted: Wed Jan 18, 2017 2:43 pm 
Offline
Member
Member
User avatar

Joined: Wed Jul 13, 2011 7:38 pm
Posts: 558
The mode parameters in the header should be stored as dd (32 bits), not dw (16 bits).


Top
 Profile  
 
 Post subject: Re: GRUB won't set video mode above 640x480x32
PostPosted: Wed Jan 18, 2017 2:54 pm 
Offline
Member
Member

Joined: Fri May 20, 2016 2:29 pm
Posts: 77
Location: Paris, France
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.

_________________
www.github.com/codyd51/axle.git


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 224 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group