Multiboot specification
Posted: Tue Jan 13, 2009 4:36 pm
hi, i've been toying around with OS dev for awhile, and recently decided to scrap all of my code and do a rewrite. however, this time around, i ran into multiboot trouble, but haven't been able to find errors. when i try to run my kernel through GRUB, it gives the "Invalid or unsupported executable format" error. i'm a bit unsure as to why, i can't find any errors within my multiboot header or lnkscript (which was pretty much copied verbatim from the bare bones tutorial). here they are:
any help would be appreciated. thanks!
Code: Select all
.set FLAG_PAGE_ALIGN, (1 << 0)
.set FLAG_MEMORY_INFO, (1 << 1)
.set FLAG_AOUT_KLUDGE, (1 << 16)
.set GRUB_HEADER, 0x1badb002
.set GRUB_FLAGS, FLAG_PAGE_ALIGN | FLAG_MEMORY_INFO | FLAG_AOUT_KLUDGE
.set GRUB_CHECKSUM, -(GRUB_HEADER + GRUB_FLAGS)
.set STACK_SIZE, 0x4000
.section .text
.align 4
multiboot_header:
.long GRUB_HEADER
.long GRUB_FLAGS
.long GRUB_CHECKSUM
.long multiboot_header
.long text
.long sbss
.long ebss
.long GrubEntryPoint
.globl GrubEntryPoint
GrubEntryPoint:
movl $(stack + STACK_SIZE), %esp
push %ebx
call _loki
hlt
.section .bss
.align 32
.lcomm stack, STACK_SIZE
Code: Select all
ENTRY (GrubEntryPoint)
SECTIONS{
. = 0x00100000;
.text :{
text = .;
*(.text)
}
.rodata ALIGN (0x1000) : {
*(.rodata)
}
.data ALIGN (0x1000) : {
*(.data)
}
.bss : {
sbss = .;
*(COMMON)
*(.bss)
ebss = .;
}
}