From: Andres Salomon Date: Tue, 15 May 2012 09:30:32 +0000 (-0700) Subject: installer: fill in inst.fth's backup size check X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=inline;p=xodist installer: fill in inst.fth's backup size check If device doesn't support " #blocks" (like, for example, /nandflash), fall back to calling " size". Signed-off-by: Andres Salomon --- diff --git a/inst.fth b/inst.fth index 8c3e6d0..47af32c 100644 --- a/inst.fth +++ b/inst.fth @@ -5,17 +5,12 @@ dup " #blocks" rot $call-method ( ih #blocks ) ?dup 0<> if \ we're assuming a block size of 512 bytes - d# 512 um* ( ih #bytes ) - d# 1,000,000 um/mod ( ih rem #MB ) - rot close-dev swap drop ( #MB ) + d# 512 um* ( ih bytes.lo bytes.hi ) else -\ TODO - drop - 0 -\ dup " block-size" rot $call-method ( ih size x ) -\ rot close-dev drop ( size.lo ) -\ d# 20 >> ( #MB ) + dup " size" rot $call-method ( ih size.lo size.hi ) then + d# 1,000,000 um/mod ( ih rem #MB ) + rot close-dev nip ( #MB ) else 0 ( #MB ) then @@ -122,17 +117,6 @@ d# 128 buffer: verifystr then ; -\ : disk-size ( devspec$ -- #MB ) -\ open-dev ?dup 0<> if ( ih ) -\ dup " size" rot $call-method ( ih size.lo size.hi ) -\ rot close-dev drop ( size.lo ) -\ d# 20 >> ( #MB ) -\ \ fuck your signed 32bit division.. d# 100000 / ( #MB ). -\ else -\ 0 ( #MB ) -\ then -\ ; - : debxo-find-targets ( -- help0$ 'func0 'icon0 ... helpk$ 'funck 'iconk ) 0 to nr-targets