Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am making a simple operating System in C, (from scratch)
I use a Loader.asm and a bootload.asm file for Loading my OS.
kmain.c contains the basic kernel functions
and print.c contains the int main(void) function that prints some text
on screen.
I compile ALL the files together using this batch script :
REM buildall.bat
REM By Sids123 (ALLDESP) on CodePlex.com
REM Builds everything and copies it to an OS.img file
@echo off
@echo Building Main Files
gcc -ffreestanding -fno-builtin -nostdlib -c *.c
nasm -f aout Loader.asm -o Loader.o
ld -Ttext 0x1000 -o kernel.bin Loader.o kmain.o print.o
nasm -f bin bootload.asm -o bootload.bin
@echo Copying Files to OS.img
copy /b bootload.bin + kernel.bin os.img
echo Done!!!
pause

But ld is not able to copy .o files to generate a kernel.bin
I get the following Message by Ld.exe
Loader.o File not recognized : File Format no recognized

Any Solutions to this,

Help would be appreciated,

~Sids123
Posted
Comments
sid2x 13-Aug-13 7:49am    
Could it be a problem with my MingW Installation???
P.S I have MingW and Cygwin on the Same System... (Could that be a problem??)
sid2x 13-Aug-13 10:13am    
Nobody has a solution to a GNU RELATED PROBLEM?????
Jochen Arndt 13-Aug-13 10:35am    
If you feed Google with 'ld aout' you will see that others had the same problem: Your ld version does not support the aout format. Your problem is probably sourced by trying to build the image on a Windows system.

1 solution

nasm -f aout Loader.asm -o Loader.o

looks wrong. Why arent you using aout instead of elf?
 
Share this answer
 
Comments
sid2x 16-Aug-13 5:18am    
Great!!! Thanks Man!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900