Can you solve my problem about linking ?
Posted: Mon Aug 25, 2008 12:23 am
how can i compile and link my os parts in windows environment and with GCC & NASM ?
pleas help me and say with wich commandline options i can compile my kernel truly in windows?
the commandlins that i use are :
for NASM:
nasm -f aout loader.asm -o loader.o
for gcc :
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-funct
ions -nostdinc -fno-builtin -I./include -c -o kernel.o kernel.c
for linking :
ld -r -i -e _start -Ttext 0x1000 -o os.o kernel.o graphic.o
for create binary file :
C:\cygwin\bin>objcopy -R .note -R .comment -S -O binary os.o os.bin
for example my problem is in linking , when i want to call an external function that i write in other file for example an OBJ file that compiled with nasm or an OBJ file that compiled with GCC same as graphic.o , after linking these parts , I disassemble the output obj file and i see that when a function called , the call function in assembly code , called an incorrect address that there not exist a valid function .
my NASM version is 2.02
my GCC version is 3.4.4
pleeeeeeas help to me , i work on this problem about 3 month but still i can't solve that .
im sorry for my bad english writing.
pleas help me and say with wich commandline options i can compile my kernel truly in windows?
the commandlins that i use are :
for NASM:
nasm -f aout loader.asm -o loader.o
for gcc :
gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-funct
ions -nostdinc -fno-builtin -I./include -c -o kernel.o kernel.c
for linking :
ld -r -i -e _start -Ttext 0x1000 -o os.o kernel.o graphic.o
for create binary file :
C:\cygwin\bin>objcopy -R .note -R .comment -S -O binary os.o os.bin
for example my problem is in linking , when i want to call an external function that i write in other file for example an OBJ file that compiled with nasm or an OBJ file that compiled with GCC same as graphic.o , after linking these parts , I disassemble the output obj file and i see that when a function called , the call function in assembly code , called an incorrect address that there not exist a valid function .
my NASM version is 2.02
my GCC version is 3.4.4
pleeeeeeas help to me , i work on this problem about 3 month but still i can't solve that .
im sorry for my bad english writing.