Page 202 - The Unofficial Guide to Lego Mindstorms Robots
P. 202
191
legOS is built using egcs, the open-source successor to the GNU gcc compiler. To build legOS, you'll also need GNU's
binutils package. These tools are present on most Linux systems, but they must be reconfigured to support cross-
co mpilatio n for the RCX. I'll explain this process soon.
If you're not runni ng Linux, don't despair. On a Unix-like operating system, you can probably build egcs and binutils
yourself, or find someone who has binaries for your platform. See the "Online Resources" section later in this chapter for
information on obtaining egcs and binutils.
Cygwin
What if you're not running Linux or a Unix-like operating system? If you have Windo ws instead, there is a way to make
Windows act like Linux. The Cygwin package from Cygnus Solutions is a port of many GNU tools to Windows 95, 98, and
NT. Like lots of GNU stuff, it's a little bulky. A full download is about 13 MB, comp ressed. If you're a Linux enthusiast
trapped in a Microsoft world, though, you'll definitely want to check this out. (The "Online Resources" section has more
information on obtaining Cygwin.)
Setting Up egcs
To compile legOS, you're going to need to configure egcs as a cross compiler for the RCX. There are two ways to do this:
1 . You can recompile egcs itself to make it into a cross compiler.
2. You can download someone else's binary version of the egcs cross compiler.
Obviously, the second option is a lot easier, if you can find somebody who's created the cross compiler for your particular
platform. The "Online Resources" section at the end of this chapter lists web sites that contain instructions for recompiling
egcs as well as the locations of popular binaries of the cross compiler.
Oh, and Perl Too
Part of compiling leg OS involves running some Perl. You'll need to have Perl installed on your computer to make legOS
programs. As before, Linux users probably have Perl lying around already. If you've installed Cygwin on your Windows
machine, you'll need to go get Perl. See "Online Resources" for more information.
D ownloading Firmware
Once you have successfully compiled something in legOS, you will need to download it to your RCX to run it. To do this, you
need a small utility that's called a