olpc.fth
Jerry Vonau
jvonau at shaw.ca
Thu Feb 3 18:02:07 EST 2011
On Thu, 2011-02-03 at 15:52 -0600, Jerry Vonau wrote:
> On Thu, 2011-02-03 at 15:37 -0600, Jerry Vonau wrote:
> > On Thu, 2011-02-03 at 16:21 -0500, Martin Langhoff wrote:
> > > On Thu, Feb 3, 2011 at 4:16 PM, Jerry Vonau <jvonau at shaw.ca> wrote:
> > > > Just a quick question is it possible to run commands that are available
> > > > at OFW prompt inside the olpc.fth file? I'm looking at trying to run
> > > > add-tag-from-file from within olpc.fth.
> > >
> > > I used to think you could, but according to Reuben and Mitch... you
> > > can't. By the time boot.fth gets executed, OFW has put the memory back
> > > in readonly mode.
> > >
> > > So the add-tag game should be done with a proper keyjector.
> > >
> > > Impractical but safer.
> > >
> >
> > Then the trick for olpc.fth would be to store the info and reboot to
> > flash the info in, like how bootfw.zip is handled.
> >
> > just thinking out loud,
>
> Just found this gem:
>
> http://dev.laptop.org/pub/firmware/scripts/newkatag.fth
>
> looks to be do-able,
>
> Jerry
Rough proof of concept attached.
-------------- next part --------------
\ OLPC boot script
visible
showstack
d# 111 constant /s1
/s1 buffer: keybuf
: key-map: ( "name" "filename" -- )
create safe-parse-word ",
does> count ( filename$ )
$read-open
keybuf /s1 ifd @ fgets
/s1 <> abort" File read failure"
ifd @ fclose
keybuf /s1 " s1" ( value$ name$ )
2dup find-tag if 2drop 2swap 1- 2swap $change-tag else $add-tag then
;
key-map: newtag u:\boot\s.pub
: doit ( -- )
cr
." 1 to install s-key from USB" cr
cr
key [char] 1 = if
." Continuing to install skey" cr
newtag
else
." Not installing" cr
then
;
doit
More information about the Devel
mailing list