Saturday, January 1, 2011

Cross Compiler setup on Ubuntu 10.10 PowerPC64

Well I have been reading a lot on Operating System Development at osdev.org and a few weeks ago decided to work on my own operating system.
Here is how I build the cross compilers for development:

gnu.org is where I got the dev tools from
  • Downloaded binutils-2.21.tar.bz2
  • Downloaded gcc-core-4.5.2.tar.bz2
  • Downloaded gcc-g++-4.5.2.tar.bz2
I got GMP, MPFR and MPC From the Ubuntu repositories via apt-get.

After I installed the requirements ( GMP, MPFR, MPC ) I followed the rest of the cross-compiler setup guide.

The following were the commands as I modified them ( not much ):
  • cd ~/Downloads/binutils*
  • export PREFIX=/usr/local/cross
  • export TARGET=i586-elf
  • ./configure --target=$TARGET --prefix=$PREFIX --disable-nls
  • make all
  • sudo make install
  • cd ~/Downloads/gcc*
  • export PATH=$PATH:$PREFIX/bin
  • ./configure --target=$TARGET --prefix=$PREFIX --disable-nls --without-headers --enable-languages=c,c++
  • make all-gcc
  • sudo make install-gcc
After this is all complete, I can checkout my copy of my operating system code from the subversion server, build it and test with Bochs. It turns out that on PowerPC64 Linux I have to use QEMU, so I don't get all the nice debug output I was getting from Bochs. I guess I will have to look for another way to debug the kernel I am building.

No comments: