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.
suthers
Member
Posts: 672 Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:
Post
by suthers » Fri Feb 08, 2008 10:54 am
This is the batch file i use for linking, assembling and compiling:
Code: Select all
"C:\My OS\nasm-0.98.35-win32\nasm.exe" -o "C:\My OS\SOS\bootloader.o" "C:\My OS\SOS\bootloader.asm" -f bin
"C:\Dev-Cpp\bin\gcc.exe" "C:\My OS\SOS\kernel.c" -o "C:\My OS\SOS\kernel.o" -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -c
"C:\My OS\nasm-0.98.35-win32\nasm.exe" -o "C:\My OS\SOS\main_init.o" "C:\My OS\SOS\main_init.asm" -f aout
"C:\My OS\elfbinutils2112\ld.exe" -T "C:\My OS\SOS\link.ld" -o "C:\My OS\SOS\kernel.o" "C:\My OS\SOS\kernel.o" "C:\My OS\SOS\main_init.o"
PAUSE
it works fine until the linking which says:
kernel.o: file not recognized: file truncated.
Kernel.c compiles fine and kernel.o is formed, but ld deletes it.
Any ideas why this happens
Thanks in advance,
Jules
StephanvanSchaik
Member
Posts: 127 Joined: Sat Sep 29, 2007 5:43 pm
Location: Amsterdam, The Netherlands
Post
by StephanvanSchaik » Fri Feb 08, 2008 11:00 am
"C:\My OS\nasm-0.98.35-win32\nasm.exe" -o "C:\My OS\SOS\bootloader.o" "C:\My OS\SOS\bootloader.asm" -f bin
"C:\Dev-Cpp\bin\gcc.exe" "C:\My OS\SOS\kernel.c" -o "C:\My OS\SOS\kernel.o" -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -c
"C:\My OS\nasm-0.98.35-win32\nasm.exe" -o "C:\My OS\SOS\main_init.o" "C:\My OS\SOS\main_init.asm" -f aout
"C:\My OS\elfbinutils2112\ld.exe" -T "C:\My OS\SOS\link.ld" -o "C:\My OS\SOS\kernel.o" "C:\My OS\SOS\kernel.o" "C:\My OS\SOS\main_init.o"
PAUSE
Why is it specified twice?
suthers
Member
Posts: 672 Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:
Post
by suthers » Fri Feb 08, 2008 11:29 am
Thanks that fixed it.
That was kind of stupid
Jules