the C file doesn't have anything special and my asm file has the entry point symbol(and I set it to format coff) and the asm file is the first object in the command line!
now which makes sense to link first? the asm file right? No, not this screwed up crap!
I have tried everything but there is no way to get about this working it just demands to link the C file first!
the only difference between them that could matter is the size of object files, the C file is bigger there, but could that make a difference!?
this is my linker script
Code: Select all
ENTRY(start)
SECTIONS
{
.text 0x100000 : {
*(.text)
}
.data : {
*(.data)
}
.bss :
{
*(.bss)
}
}
makefile:
Code: Select all
_OBJS=.objs/kernel/kernel.o
_CFLAGS= -nostartfiles -ffreestanding -nostdlib -nostdinc -s -I./include -march=i486 -DDEBUG -DNDEBUG
_LFLAGS=-s -nostartfiles -nostdlib -Tlink.ld
_FLOPPY_DRIVE=B:
default:
fasm asm.asm asm.o
gcc $(_CFLAGS) -c kernel/kernel.c -o .objs/kernel/kernel.o
ld $(_LFLAGS) -o jouleos.bin asm.o $(_OBJS)
objcopy -O binary jouleos.bin