peteg's blog - hacking - mindstorms - 2005 12 03

/hacking/mindstorms | Link

Wow, things start working. I ripped Markus Strickler's mostly-beautiful osx_usb.{ch} out of the aforementioned lejOS tree and started hacking it into brickOS's mangled dll (dynamic linker and loader). The code for all these sorts of tools starts out as a minor variant of Kekoa Proudfoot's seminal work, is extended with various hacks to get things working under Windows, Linux with that new USB driver, on Solaris, etc. etc. and ends in Mac OS X users tearing their hair out. The code started out as a proof-of-concept and is now more-or-less unmaintainable.

Well, that's my excuse for ungently hacking out the bits I didn't need (viz the old serial device mechanisms, and Windows and Linux support). If the brickOS website looked less dead I may have tried to do it tidily and submitted a patch. As it is, I'm just going to package it up to save the hair of my fellow Mac OS X users. Some notes:

  • Things are slow; quad-rate download is unsupported.
  • My RCX had a default LNP (brickOS's "Lego™ Network Protocol") address of 2. You need to specify this when using dll. The following worked for me:
    dll -v -p1 ../demo/helloworld.lx --rcxaddr=2
    
    You can find the address by using the View button: the address is the number that comes up after Addr when you cycle through it, ignoring the final '0'. You can set it by pressing Prgm when it is displayed.

The tools are available here. They are imperfect but enough to get started. I may hack them a bit further into shape in the future, and if you do please send me the results.

With the confidence that I can now get my programs onto the RCX I started building the Logo turtle featured in the Syngress 10 Cool Lego Mindstorms Robotics Invention System 2 Projects book. It's a mechanical marvel. I wonder if it's capable of drawing a smooth curve.