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.
codyd51
Member
Posts: 77 Joined: Fri May 20, 2016 2:29 pm
Location: London, UK
GitHub: https://github.com/codyd51
Contact:
Post
by codyd51 » Wed Jan 18, 2017 11:45 am
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
Posts: 501 Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece
Post
by glauxosdever » Wed Jan 18, 2017 12:18 pm
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
matt11235
Member
Posts: 286 Joined: Tue Aug 02, 2016 1:52 pm
Location: East Riding of Yorkshire, UK
Post
by matt11235 » Wed Jan 18, 2017 12:19 pm
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
Posts: 34 Joined: Wed Oct 12, 2016 11:32 am
Location: At my PC
Post
by hannah » Wed Jan 18, 2017 12:33 pm
Try putting -vga std on your QEMU command line.
codyd51
Member
Posts: 77 Joined: Fri May 20, 2016 2:29 pm
Location: London, UK
GitHub: https://github.com/codyd51
Contact:
Post
by codyd51 » Wed Jan 18, 2017 1:01 pm
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 $^
Kazinsal
Member
Posts: 559 Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:
Post
by Kazinsal » Wed Jan 18, 2017 2:43 pm
The mode parameters in the header should be stored as dd (32 bits), not dw (16 bits).
codyd51
Member
Posts: 77 Joined: Fri May 20, 2016 2:29 pm
Location: London, UK
GitHub: https://github.com/codyd51
Contact:
Post
by codyd51 » Wed Jan 18, 2017 2:54 pm
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.