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.
pytr
Post
by pytr » Tue Sep 30, 2003 11:19 am
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
one
Post
by one » Tue Sep 30, 2003 11:33 am
try adding this line to it (you may use any other supported format also) before the ENTRY line
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
pytr
Post
by pytr » Tue Sep 30, 2003 11:40 am
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