Using VESA in the GRUB Multiboot header.
Posted: Sat Jan 26, 2008 10:02 pm
I recently started wanting to switch into a new video mode. Now, I thought I'd go about writing a VM86 Monitor, and call the interrupt through my kernel. Which, in the long run, is a better idea, and will be implemented, but due to certain circumstances, I want to switch into a video mode prior to booting my kernel. The multiboot header specification actually allows us to set a desired video mode within the header. Unfortunately, GRUB doesn't allow this. So I applied a patch and re-built and installed. The funny thing is, it still doesn't set the desired video mode.
The size of stage2 is much bigger than before (A few KB) so I assume that it IS made properly, and includes the newer code.
The patch is here:
http://www.smk.co.za/software/vbe-grub/
Actually, since Brynet is the author of the patch, maybe he'd like to shed some light on this subject?
Oh, yes, I almost forgot, I AM setting up the data within the header itself:
The size of stage2 is much bigger than before (A few KB) so I assume that it IS made properly, and includes the newer code.
The patch is here:
http://www.smk.co.za/software/vbe-grub/
Actually, since Brynet is the author of the patch, maybe he'd like to shed some light on this subject?
Oh, yes, I almost forgot, I AM setting up the data within the header itself:
Code: Select all
MULTIBOOT_PAGE_ALIGN equ 1<<0
MULTIBOOT_MEMORY_INFO equ 1<<1
MULTIBOOT_AOUT_KLUDGE equ 1<<16
MULTIBOOT_VESA equ 1<<2
MULTIBOOT_HEADER_MAGIC equ 0x1BADB002
MULTIBOOT_HEADER_FLAGS equ (MULTIBOOT_PAGE_ALIGN) | (MULTIBOOT_MEMORY_INFO) | (MULTIBOOT_VESA) | (MULTIBOOT_AOUT_KLUDGE)
MULTIBOOT_CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
;;;;;;;;;
VESA_MODE equ 0 ;;linear
VESA_WIDTH 800
VESA_HEIGHT 600
VESA_DEPTH 32 ;;;24
;;;;;;
_mboot:
dd MULTIBOOT_HEADER_MAGIC
dd MULTIBOOT_HEADER_FLAGS
dd MULTIBOOT_CHECKSUM
; aout kludge. These must be PHYSICAL addresses
dd _mboot
_k_start: dd code
dd bss
_k_end: dd end
dd kernel_entry
_VESA:
dd VESA_MODE
dd VESA_WIDTH
dd VESA_HEIGHT
dd VESA_DEPTH