GRUB doesn't set a right multiboot info?
Posted: Thu Apr 10, 2014 9:38 pm
bootstrap.s
Makefile
I use this multiboot header and I think grub2 DO initialize the VBE for me because I really get a 800*600 (or 1024*768 when I change the videomode field in multiboot_header)qemu window after I boot my kernel.But When I begin to debug, I found that flags in multiboot_info is 0x1267, the bit[11] is not set,so I can't get the VBE information.what's wrong?
Code: Select all
.section .text
.global start
multiboot_header:
required:
.long 0x1BADB002
.long 0x00000007
.long -(0x1BADB002 + 0x00000007)
addr_ignored:
.long 0
.long 0
.long 0
.long 0
.long 0
videomode:
.long 0
.long 800
.long 600
.long 32
start:
.skip 16384
stack:
movl $stack, %esp
cli
push %ebx
call kernel_main
Makefile
Code: Select all
GCC=gcc
LD=ld
LDSCRIPT=linker.ld
GAS=as
all: kernel.elf
kernel.elf: bootstrap.o
$(LD) bootstrap.o kernel.o -g -o kernel.elf -T $(LDSCRIPT)
install: kernel.elf
mount /dev/sdb1 /mnt
cp kernel.elf /mnt -f
umount /mnt
bootstrap.o: bootstrap.s kernel.c
$(GAS) bootstrap.s -g -o bootstrap.o
$(GCC) kernel.c -std=c99 -c -g -o kernel.o
clean:
rm -f *.o *.elf
test:
qemu-system-x86_64 -vga std -hda /dev/sdb