Page 1 of 1

GRUB -> format not supported

Posted: Tue Sep 30, 2003 11:19 am
by pytr
GRUB keep saying that my kernel is in a not supported format :(
I'm running WinXP with DJGPP.

This is my linkerscript:

physical_load_addr = 0x00101000;
ENTRY (KernelEntry)

SECTIONS
{
. = physical_load_addr;

.text :
{
*(.text)
*(.rodata)
}

.data ALIGN (0x1000) :
{
*(.data)
}

.bss :
{
_sbss = .;
*(COMMON)
*(.bss)
_ebss = .;
}
}


And this is how I compile the kernel:

nasmw -f aout kernel_start.asm -o ks.o
gcc -nostartfiles -nostdlib -fno-builtin -fwritable-strings -o kernel.o -c kernel.c
ld -T link.ld -o kernel.bin ks.o kernel.o

Re:GRUB -> format not supported

Posted: Tue Sep 30, 2003 11:33 am
by one
try adding this line to it (you may use any other supported format also) before the ENTRY line

Code: Select all

OUTPUT_FORMAT("binary")
btw why are you loading at 0x101000 are you sure you are jumping here?
and yeah have you added the MULTIBOOT header etc in the asm file?
Check these and let me know

Re:GRUB -> format not supported

Posted: Tue Sep 30, 2003 11:40 am
by pytr
Yup. Here's the asm file:

; start.asm

global KernelEntry
extern _KernelMain

bits 32
segment .text

F_PAGE_ALIGN equ 1<<0
F_MEM_FIELDS equ 1<<1

MAGIC equ 0x1BADB002
FLAGS equ F_PAGE_ALIGN | F_MEM_FIELDS
CHECKSUM equ -(MAGIC + FLAGS)

KernelEntry:
mov esp, 0x00101000
push ebx
call _KernelMain

; The Multiboot header

align 4
dd MAGIC
dd FLAGS
dd CHECKSUM