Thomas (boggyb) wrote,

  • Mood:
  • Music:

Doing silly things with cross-compilers, part 1 (installing MinGW)

Since getting that NAS, I've been poking around and looking at adding some useful programs to the existing firmware. The initial one I want to run on it is smartmontools, so I can see just what start the hard disks are in and try and prod the second one into actually responding.

As with most embedded stuff, it runs Linux. So getting my own code to run is merely a case of building a cross-compiler that'll run on an actual system and produces output that works on the NAS' armv5l-linux architecture. Actually, since this is a NAS with actual disks I'm not limited to the pokey little flash chip that most embedded stuff has (this device has 16MB of flash - most routers have 8MB or even only 4MB!) and so I could run the compiler on the NAS itself. Unfortunately, it doesn't come with one, and to build a compiler you first need a compiler. Hence the need for a cross-compiler. Since the target is Linux that'd normally mean I'd also need to install a Linux development environment, which I'd rather not have to do - Linux and I don't get on well.

Now, something I tripped across recently is a page on the MinGW website, containing instructions for building a cross-compiler hosted under MinGW. The useful part of this for me is that MinGW along with MSYS is a port of a whole bunch of Linux tools to Windows. So in theory I should be able to use that to build and run my cross-compiler on Windows. This is completely against the normal way of doing things, but the wiki page is proof that it should be possible.

Unfortunately the instructions are rather out of date, so I'm having to make it up as I go along (using a vaguely recent set of instructions for a GNU/Linux ARM toolchain and an older Linux/ARM howto for more recent details). I intend to document this as I go along, partially as a set of notes to myself, partially in the hope that the next person to try this finds it useful, but mainly so you can all point and laugh when it inevitably fails in some spectacular fashion.

Part 1: Installing MinGWCollapse )
Tags: computing, nas adventures

  • Summon giant frog?

    Impa has a rather unusual finishing move in Hyrule Warriors Calamity...

  • King Dorephan = Boss Nass?

    Is it just me, or does King Dorephan from Hyrule Warriors: Calamity remind anyone else of Boss Nass from Star Wars: Episode 1? I was slightly…

  • Link's Awakening: the third nightmare

    So I actually wrote most of this in November last year... but never got round to posting it. Anyway, since people have been asking for more posts -…

  • Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.