Page 201 - The Unofficial Guide to Lego Mindstorms Robots
P. 201

190


          legOS is more of a library than an OS, in some ways. The programs you write are compiled with the legOS source code to
          p roduce a  firmware. To run your  program you need to download the whole thing to the RCX.  This makes for a clumsy
          development cycle: even though you're only changing your own code, you need to recompile with legOS and download the
          whole firmware each time. pbFORTH, by contrast, is an interpreter. You only have to download it once to the RCX; after that,
          you can program it using a term inal emulator.

          As time passes, someone will probably write a rudimentary set  of tools so that you can leave legOS on the RCX and download
          new user programs to it. For now, though, no such facility exists.

          Figure 10-1 shows the architecture of legOS. On the PC side, some kind of cross com piler compiles your code with the legOS
          code to produce a firmware. To get your program on the RCX, you need to use a fi rmware downloader tool, like nqc or
          firmdl. Once downloaded, the firmware lives in the RAM of the RCX, running what ever program you have created.


























                                                        Figure 10-1.
                                                 legOS software architecture

          De velopment Tools

          You'll need some heavy-duty   tools to work  with legOS. (There is another  possibility, as described in the sidebar, ''An
          Innovative Alternative.") The good n ews is that the tools are free. The basic tool you need is a cross compiler, a tool that runs
          on one platform but produces exec u table files for another. In this case, you want a cross compiler that runs on your PC and
          produces firmware for the RCX .
   196   197   198   199   200   201   202   203   204   205   206