Where to start ?

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.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Where to start ?

Post by Candy »

Might I advise building a cross-compiler?

(would that advice be called candybot or solarbot? ;))
Phugoid

Re:Where to start ?

Post by Phugoid »

You really need to create a cross-compiler for kernel development, as you are producing code which does not run in an environment hosted by an OS (as your current compiler assumes).

Try following this:
http://www.osdev.org/osfaq2/index.php/GCC%20Cross-Compiler

I don't think you have download specifically that version of GCC or binutils - try a more recent one. You can also choose another target instead of ELF, what is important is that during configuration you supply all the options that tell GCC to forget standard headers and libraries.
jason7007

Re:Where to start ?

Post by jason7007 »

Hi,
I am using gcc-core ver. 3.4.4-1. And also downloaded the make, flex, bison from ftp://cygwin.dp.ua.

Then ran the batch file build.bat in Cygwin but still the same
problems.

Thank you anyway.
Phugoid

Re:Where to start ?

Post by Phugoid »

Did you download and build from source code? It seems that you have simply downloaded another copy of the tools you already have. What you need to do is download the source code for the tools, and create slightly different versions from it (as explained in the FAQ).

You will need to do this for binutils and gcc:
http://ftp.gnu.org/gnu/binutils/
http://ftp.gnu.org/gnu/gcc/gcc-4.0.2/
jason7007

Re:Where to start ?

Post by jason7007 »

Hi,
This getting very complicated, I am a newbie and not a Unix/Linux guy.

For now I just admit I am defeated using Cygwin and gonna go back to use DJGPP for DOS.

Thank you so much.
Phugoid

Re:Where to start ?

Post by Phugoid »

I think most people here are not Unix/Linux guys and I certainly am not. To build the cross-compiler you need, you are only required to download and extract the binutils and gcc sources, and then enter the commands given in "Step 1 - Bootstrap" in the FAQ at a bash shell, which is the default for Cygwin. You may need to make slight modifications for different path names, at most.

To invoke the new tools when you are done, you issue commands like /usr/cross/bin/i386-elf-gcc, depending of course on the actual path to your binaries, the target you chose (i386-elf in this case) and the tool (gcc, ld, objdump, etc). You can also set up an environment variable, but that is not necessary at this point.
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:Where to start ?

Post by kataklinger »

Or you can start using MS tools :)
Post Reply