HELP
Posted: Mon Sep 10, 2007 1:08 pm
Hey well I've been trying to make an OS for about a year now
but i have never been able to make one link.
I use this command line to assemble:
nasm -f elf -o start.o start.asm
This is my asm code:
[BITS 16]
global start
start:
extern _main
call _main
jmp $
times 510-($-$$) db 0
dw 0xAA55
I use this command line to compile:
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -c -o main.o main.cpp
This is my c code:
int main()
{
}
until there i don't get any errors,
but when i try to link with this command line:
ld -o kernel.bin start.o main.o
and it gives me the following error:
C:\Dev-Cpp\bin\ld.exe: warning: cannot find entry symbol _mainCRTStartup; defaul
ting to 00401000
main.o(.text+0xf):main.cpp: undefined reference to `_alloca'
main.o(.text+0x14):main.cpp: undefined reference to `__main'
can anybody tell me what to do (it getting really annoying trying to make an OS and not getting further than a "Hello World!" boot loader.
Thanks in advance,
Jules
but i have never been able to make one link.
I use this command line to assemble:
nasm -f elf -o start.o start.asm
This is my asm code:
[BITS 16]
global start
start:
extern _main
call _main
jmp $
times 510-($-$$) db 0
dw 0xAA55
I use this command line to compile:
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -c -o main.o main.cpp
This is my c code:
int main()
{
}
until there i don't get any errors,
but when i try to link with this command line:
ld -o kernel.bin start.o main.o
and it gives me the following error:
C:\Dev-Cpp\bin\ld.exe: warning: cannot find entry symbol _mainCRTStartup; defaul
ting to 00401000
main.o(.text+0xf):main.cpp: undefined reference to `_alloca'
main.o(.text+0x14):main.cpp: undefined reference to `__main'
can anybody tell me what to do (it getting really annoying trying to make an OS and not getting further than a "Hello World!" boot loader.
Thanks in advance,
Jules