olpc.fth question

Kevin Gordon kgordon420 at gmail.com
Tue Jun 12 11:08:29 EDT 2012

Disclaimer:  Newbie Forth question ....:-)

We are trying to create a consolidated unsecured update stick.

This is not for use in the real world, but in our wild lab.

We have learned and experimented a lot today, and everything pretty much
humming along nicely, to a point:

We have borrowed oodles of forth code from various sources and put together
a nice little olpc.fth file which is sitting in the /boot directory on the
USB stick.

We then have an 885 .img file with the XO1 image, and an 885 .zd4 file with
the XO1.5 image in the root of the stick.

We hae coded it such that If we hit no game keys on the boot process, all
machine(s) boot up normally - just like there was no stick inserted.  This
is the desired effect.

If we hit the circle game key a bunch of stuff gets done.  However, our
attempt to select and execute fs-update when the machine is a 1.5, or
copy-nand when the machine is a 1.0 is not working.  It would appear that
forth perhaps wants to parse the statements and fails because there is no
command copy-nand in the 1.5 firmware or fs-update in the 1.0 firmware.  If
we use separate dedicated sticks without the offending command in the if
statement, the machines flash beautifully.

Basically, as it stands right now, we have working separate olpc.fth files
for each of the machines, which isnt that inconvenient, and does enable us
to auto-flash non-secure (security-disabled) machines quickly (with
non-signed custom OOB builds) via game-key press rather than madly hitting
the x key and then typing the correct command.

So for those coming from a non-Forth background, we have hit a road block.
Is there perhaps a way to store a 'possible' command into a variable then
execute that 'variable' as a command, thereby perhaps bypassing any of the
apparent syntax error checking?   Unexpected end-of-line is the most common
result from attempting to call within an if statement.  Or, we get
copy-nand? on the 1.5 or fs-update? on the 1.0 when the command exists in
the source - whether it will actually get 'called' or not ,based on the
variable containing the machine type..

Or, is there an entirely more elegant way to accomplish this?

Thanks for any hints.  And, apologies in advance to those shaking their
heads violently at our incompetence :-)

KG and AG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/devel/attachments/20120612/5e6c590c/attachment.html>

More information about the Devel mailing list