[openfirmware] r1024 - cpu/x86/pc/olpc

svn at openfirmware.info svn at openfirmware.info
Sat Dec 6 11:40:12 CET 2008


Author: wmb
Date: 2008-12-06 11:40:12 +0100 (Sat, 06 Dec 2008)
New Revision: 1024

Modified:
   cpu/x86/pc/olpc/fsupdate.fth
   cpu/x86/pc/olpc/nandcastui.fth
   cpu/x86/pc/olpc/security.fth
   cpu/x86/pc/olpc/wifichannel.fth
Log:
OLPC NANDblaster - made the receiver work in secure mode.

Modified: cpu/x86/pc/olpc/fsupdate.fth
===================================================================
--- cpu/x86/pc/olpc/fsupdate.fth	2008-12-04 23:59:50 UTC (rev 1023)
+++ cpu/x86/pc/olpc/fsupdate.fth	2008-12-06 10:40:12 UTC (rev 1024)
@@ -187,10 +187,8 @@
 : try-fs-update  ( -- )
    ." Searching for a NAND file system update image." cr
    " disk: sd:" fs-update-from-list
-   secure? 0=  if
-      ." Trying NANDblaster" cr
-      ['] nandblaster catch  0=  if  exit  then
-   then
+   ." Trying NANDblaster" cr
+   ['] nandblaster catch  0=  if  exit  then
    " http:\\172.18.0.1" fs-update-from-list
 ;
 

Modified: cpu/x86/pc/olpc/nandcastui.fth
===================================================================
--- cpu/x86/pc/olpc/nandcastui.fth	2008-12-04 23:59:50 UTC (rev 1023)
+++ cpu/x86/pc/olpc/nandcastui.fth	2008-12-06 10:40:12 UTC (rev 1024)
@@ -24,17 +24,28 @@
    r> close-dev
 ;
 
+: secure$  ( -- adr len )
+   secure?  if  " secure"  else  null$  then
+;
+
 d# 20 value redundancy
 
 : #nb  ( channel# -- )
    depth 1 < abort" Usage: channel# #nb"
-   " rom:nb_rx ether:%d" sprintf boot-load go
+   secure$ rot
+   " rom:nb_rx ether:%d %s" sprintf boot-load go
 ;
 : #nb-clone  ( channel# -- )
    depth 1 < abort" Usage: channel# #nb-clone"
    redundancy swap
    " rom:nb_tx ether:%d nand: %d" sprintf boot-load go
 ;
+: #nb-copy  ( image-filename$ channel# -- )
+   depth 3 < abort" #nb-copy - too few arguments"
+   >r 2>r                             ( placement-filename$ r: channel# image-filename$ )
+   redundancy  2r> r>                 ( redundancy image-filename$ channel# )
+   " rom:nb_tx ether:%d %s %d 131072" sprintf boot-load go
+;
 : #nb-update  ( placement-filename$ image-filename$ channel# -- )
    depth 5 < abort" #nb-update - too few arguments"
    >r 2>r                             ( placement-filename$ r: channel# image-filename$ )
@@ -50,12 +61,19 @@
    redundancy  2r> r>                 ( siglen sigadr speclen specadr redundancy image-filename$ channel# )
    " rom:nb_tx ether:%d %s %d 131072 %d %d %d %d" sprintf boot-load go
 ;
-: t1  " u:\os767.plc" " u:\os767.img" d# 11 #nb-update  ;
-: t2  " u:\fs.zip" " u:\os767.img" d# 11 #nb-secure  ;
 
 : nb-clone1  ( -- )  1 #nb-clone  ;
 : nb-clone6  ( -- )  6 #nb-clone  ;
 : nb-clone11  ( -- )  d# 11 #nb-clone  ;
+
+: nb-update1  ( -- )  1 #nb-update  ;
+: nb-update6  ( -- )  6 #nb-update  ;
+: nb-update11  ( -- )  d# 11 #nb-update  ;
+
+: nb-secure1  ( -- )  1 #nb-secure  ;
+: nb-secure6  ( -- )  6 #nb-secure  ;
+: nb-secure11  ( -- )  d# 11 #nb-secure  ;
+
 : nb1  ( -- )  1 #nb  ;
 : nb6  ( -- )  6 #nb  ;
 : nb11  ( -- )  d# 11 #nb  ;

Modified: cpu/x86/pc/olpc/security.fth
===================================================================
--- cpu/x86/pc/olpc/security.fth	2008-12-04 23:59:50 UTC (rev 1023)
+++ cpu/x86/pc/olpc/security.fth	2008-12-06 10:40:12 UTC (rev 1024)
@@ -582,6 +582,7 @@
 
 dev /client-services
 : enter  ( -- )  secure? 0=  security-off?  or  if  visible enter  then  ;
+: exit   ( -- )  secure?  if  security-failure  then  exit  ;
 dend
 warning !
 

Modified: cpu/x86/pc/olpc/wifichannel.fth
===================================================================
--- cpu/x86/pc/olpc/wifichannel.fth	2008-12-04 23:59:50 UTC (rev 1023)
+++ cpu/x86/pc/olpc/wifichannel.fth	2008-12-06 10:40:12 UTC (rev 1024)
@@ -115,8 +115,12 @@
 alias nb nandblaster
 
 d# 10 constant rssi-threshold
-: nb-clone  ( -- )
+: nb-auto-channel  ( -- chan# )
    quietest-mesh-channel  ( rssi chan# )
    swap rssi-threshold > abort" No quiet channels"  ( chan# )
-   #nb-clone
 ;
+
+: nb-clone  ( -- )  nb-auto-channel #nb-clone  ;
+
+: nb-update  " u:\fs.plc" " u:\fs.img" nb-auto-channel #nb-update  ;
+: nb-secure  " u:\fs.zip" " u:\fs.img" nb-auto-channel #nb-secure  ;




More information about the openfirmware mailing list