Author: wmb Date: 2007-10-02 06:39:49 +0200 (Tue, 02 Oct 2007) New Revision: 659
Modified: cpu/x86/pc/olpc/crypto.fth cpu/x86/pc/olpc/gui.fth dev/geode/display/gxfb.fth Log: OLPC pretty boot - Fixed memory allocation problem with large image.
Modified: cpu/x86/pc/olpc/crypto.fth =================================================================== --- cpu/x86/pc/olpc/crypto.fth 2007-10-02 04:35:36 UTC (rev 658) +++ cpu/x86/pc/olpc/crypto.fth 2007-10-02 04:39:49 UTC (rev 659) @@ -48,71 +48,9 @@ \ XXX clean out dead code in usb.fth ;
-1 [if] - -\ Check that the version is an upgrade? - -: >rom-name$ ( device$ -- path$ ) - image-name-buf place ( ) - " :\boot\olpcfw.rom" image-name-buf $cat ( ) - image-name$ -; -: sig-name$ ( -- path$ ) - image-name$ + 4 - " .rom" caps-comp 0= if - " sig" image-name$ + 3 - swap move - image-name$ - else - 2drop " " - then -; -: $dev-update-flash ( device$ -- ) - >rom-name$ $get-image if exit then ( data$ ) - - sig-name$ $get-image if - ." Missing firmware update signature file: " sig-name$ type cr - free-mem exit - then ( data$ sig$ ) - - 2over 2over signature-bad? if ( data$ sig$ ) - ." Firmware update image signature mismatch: " sig-name$ type cr - free-mem free-mem exit - then ( data$ sig$ ) - - free-mem ( data$ ) - - 2dup flash-buf swap move ( data$ ) - tuck free-mem ( data-len ) - ['] ?image-valid catch if ( x ) - drop ." Firmware image failed sanity checks" cr ( ) - exit - then ( x ) - - true to file-loaded? - reflash -; -[then] - : getbin " usb8388.bin" find-drop-in 0= abort" No usb8388.bin" ; : getsig " usb8388.sig" find-drop-in 0= abort" No usb8388.sig" ; -: tc ( -- ) - getbin getsig - signature-bad? if - ." Signature was bad, expected good" cr - then
- getbin over 1 swap +! - getsig - signature-bad? 0= if - ." Signature was good, expected bad (corrupt image)" cr - then - - getbin - getsig over 40 + 1 swap +! - signature-bad? 0= if - ." Signature was good, expected bad (corrupt signature)" cr - then -; - \ LICENSE_BEGIN \ Copyright (c) 2007 FirmWorks \
Modified: cpu/x86/pc/olpc/gui.fth =================================================================== --- cpu/x86/pc/olpc/gui.fth 2007-10-02 04:35:36 UTC (rev 658) +++ cpu/x86/pc/olpc/gui.fth 2007-10-02 04:39:49 UTC (rev 659) @@ -26,25 +26,26 @@ icon-xy image-width image-height ;
+: image-base ( -- adr ) " graphmem" $call-screen ; + : $get-image ( filename$ -- true | adr,len false ) r/o open-file if drop true exit then >r ( r: fd ) - r@ fsize dup alloc-mem swap ( bmp-adr,len r: fd ) + + image-base r@ fsize ( bmp-adr,len r: fd ) 2dup r@ fgets over <> ( bmp-adr,len error? r: fd ) r> fclose ( bmp-adr,len ) - if free-mem true else false then ( true | bmp-adr,len false ) + if 2drop true else false then ( true | bmp-adr,len false ) ; : $show ( filename$ -- ) not-screen? if 2drop exit then 0 to image-width \ In case $show fails $get-image if exit then - 2dup prep-565 " draw-transparent-rectangle" $call-screen - free-mem + prep-565 " draw-transparent-rectangle" $call-screen ; : $show-opaque ( filename$ -- ) not-screen? if 2drop exit then $get-image if exit then - 2dup prep-565 " draw-rectangle" $call-screen - free-mem + prep-565 " draw-rectangle" $call-screen ; : advance ( -- ) icon-xy image-width 0 d+ to icon-xy
Modified: dev/geode/display/gxfb.fth =================================================================== --- dev/geode/display/gxfb.fth 2007-10-02 04:35:36 UTC (rev 658) +++ dev/geode/display/gxfb.fth 2007-10-02 04:39:49 UTC (rev 659) @@ -544,6 +544,8 @@ h# 0f color@ h# ff color! \ Set color ff to white (same as 15) ;
+0 instance value graphmem + : init-all ( -- ) \ Initializes the controller smb-init map-io-regs \ Enable IO registers @@ -559,6 +561,8 @@ 4 of frame-buffer-adr /fb h# ffff.ffff lfill endof endcase 7 to background-color + + frame-buffer-adr /fb + to graphmem ;
: display-remove ( -- )