It’s been a while, but recently I’ve got back in to OS Development. I tend to find I leave my old OS project alone for months (or years!) and then become inspired to go back to it. This time, it’s because I have some project ideas based on combining the Raspberry Pi with an Arduino Uno.
Anyway, each time I go back, it’s time to update the GCC Cross-Compiler (for basic instructions on how to create this, see the wiki over at OSDev.org) and a few other anciliary bits and pieces. Of course, because it’s been so long since I did any development, I’ve forgotten most of the little “gotchas” with the process.
Don’t Click on the Link Below!
The purpose of this post, therefore, is to act as an aide memoir for me and it may also possibly help someone else! I’m also putting a link up to my latest cross compiler. Now – before anyone interested in OSDev simply clicks on the link and gets going, allow me to persuade you not to click on the link!
The gzipped tar file contains the directory /cross and expects to be untarred in the /usr/local directory in cygwin. It contains cross-compilers for the i686-elf, x86_64 (yes – I know about the -m32 compiler switch…), AVR and Raspberry Pi on a 64 bit Windows Cygwin Host. This is the first reason for not downloading the gzipped file – it contains some specific cross-compilers that I use and this same subset is unlikely to be needed by anyone else, who will have their own targets in mind.
The next reason for not clicking the link, is that I think that anyone attempting OS Development should at least know their toolchain well enough to be able to build a cross-compiler. The link is provided more to be of assistance to someone who has done this before and doesn’t want to waste time doing it all over again.
The final reasons are that I provide absolutely no support for this download (an make no guarantees that it will do anything useful). It may harm your system and I do not provide any warranties against this. It may not even contain the latest version of the build tools…
Order of Installation
Now, the meat of this article follows, with the order in which I go about getting my OSDev environment back again.
Install Cygwin from the latest online installer. At a minimum, select the following packages (in addition to the automatically selected packages):
- GCC4-Core, GCC4-g++, Nasm (I am in the process of removing this dependency and switching to gnu as).
- Flex, Bison, Make
- libmpc-devel, libmpfr-devel, libgmp-devel
- Git and openssh.
Next, it’s time to compile the utilities (including cross-compilers) that will be needed as a part of my build process. These are all downloaded as .tar.gz, unzipped to usr/src and then configured in a separate build directory.
- GNU Binutils (targets: i[x]86-elf, x86_64-elf, arm-none-eabi, avr)
- GNU GCC (same targets)
- GRUB 2.00
The Cross Compilers
…and here they are!