Page 1 of 1

How to compile .bin using GCC

Posted: Mon Jun 03, 2013 11:04 pm
by Trixoloc
Hello to all here...I'm new to OSDev and I when tried the bare bones[C] I tried to compile the src[which outputs string 'Hello' World to in protected mode using....] but when I tried to compile the file it only output .obj file[pe-i386]......

Platform:win32[xp]/mingw32

Can somebody guide me here...


Thank you for giviving your precious time to this post

Re: How to compile .bin using GCC

Posted: Mon Jun 03, 2013 11:08 pm
by xenos
Obviously you didn't correctly follow the Bare Bones tutorial, as it says you need to build a GCC Cross-Compiler first.

Re: How to compile .bin using GCC

Posted: Tue Jun 04, 2013 6:03 am
by Trixoloc
actually I already have GCC build version 4.7.2 in MinGW envoirment with Orwvell forked dev gcc

Re: How to compile .bin using GCC

Posted: Tue Jun 04, 2013 7:48 am
by sortie
Read the tutorial. You need a i586-elf cross-compiler to complete it. The gcc that comes with your operating system/mingw is not intended to work with operating systems development. In this case, it's even worse, because your system compiler creates PE files rather than ELF files.

In addition, you fail to describe the errors you are having. Please use better english and post the errors you are having. Are you saying that you get an object file when you do gcc -c foo.c -o foo.o? Because that's normal. You need to link the kernel first. Follow the tutorial.

Re: How to compile .bin using GCC

Posted: Tue Jun 04, 2013 7:57 am
by xenos
Just to clarify this: the GCC that comes with your OS is not a cross compiler.