Getting Back to OSDev

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.

Cygwin

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
  • Mkisofs
  • Git and openssh.

Self-Compiled Utilities

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!

Current Projects

I’ve started to get some content together for the site and promise I’ll get something more substantial up here over the next couple of days.

Since I last posted anything on my web site, there have been a lot of changes in both career and home life. This means that programming has been put on the back burner. Out of interest, I had a look at my OS code again recently and got the old kernel booting from GRUB2 – I’m in danger of getting the programming bug again! It doesn’t help that I now have my Raspberry Pi and will be very tempted to try getting the kernel up on that, in addition to continuing with my AMD64 version.

As far as high level programming goes, I have an optometry practice management system based on C#/SQL Server that I’d like to get a bit further with. This relates more to my day job and is therefore the most likely programming project to bring in a bit of money one day :)

I enjoy teaching and would love to get some more tutorials up here as well. If only there were more hours in the day!