Using BrickOS
Ok, first thing we are going to want to do with brickos is install the firmware (note - this must be done every time the RCX loses power!)
To install firmware, open a cygwin shell and type:
cd /brickos-0.2.6.10/util
export RCXTTY=USB
./firmdl3 ../boot/brickos.srec
This will take a few minutes....
After this completes, test brickos by typing the following:
./dll ../demo/helloworld.lx
hit run on the RCX and drool over the LCD...
Now set the environment path to add the utilities, and to set USB mode for brickos. To do this you'll need to change your profile, this file is in c:/cygwin/etc/, it's called 'profile'. Edit it and change the path line to include the bricoks/util path. Mine looks like this: PATH="/usr/local/bin:/usr/bin:/bin:/brickos-0.2.6.10/util:$PATH"
Also somewhere in the file (I did this by the other 'export' statements) add the line: export RCXTTY=USB
If you DON'T do this, you will have to execute the tools by typing the full/relative path, which gets old fast. Also you'll have to 'export RCXTTY=USB' everytime you start a shell.
Here's some more instructions on making your own project from the readme.use file:
For your own projects,
- Make a directory in a location of your choosing (you may wish to make
a ~/brickOS directory and place your projects below there).
- Copy 'Makefile' from the /usr/[local/]share/doc/brickos/examples directory
to this new directory.
- Put your main routine into myproject.c. (or myproject.C if using C++)
- If you need more source files, add them in the Makefile.
- type "make myproject.lx && dll myproject.lx" to build and then download
your new code. (Remember to use -pN to select specific program slot)
In case you are wondering, dll is short for dynamic linker and loader.
You can get good help at: http://lugnet.com/robotics/rcx/legos/ should
you need to.
About making your own projects:
It is as simple as is said in the readme.
- Create a directory in the main brickos dir
- Copy the makefile from the maindir/demo directory
- Make your program in programname.c (or whatever name)
- Compile using 'make programname.lx'
- Upload using 'dll programname.lx'
I like a little more structure to keeping my programs, so I actually put my programs in maindir/myprog/programname. The only downside to this is I had to change all the '..'s in the makefile to '../..'s, which took all of a minute to do. It compiles and runs just fine though!
Good luck and happy RCXing :)
Copyright 2003 Stephen Stair
Lego, RCX, Lego Mindstorms are trademarks/owned by Lego.