[U-Boot-Users] ability to do simple math in u-boot shell?

Kim Phillips kim.phillips at freescale.com
Wed Feb 13 07:56:05 CET 2008


On Tue, 12 Feb 2008 23:45:35 -0600
Kumar Gala <galak at kernel.crashing.org> wrote:

> I can't seem to find anything that says we can do thus, but wondering  
> if there was any way to get simple math (addition) out of the u-boot  
> shell?  Was looking for something like 'expr'.

hush doesn't do expressions - everything's a string - you need to
import something like shell/ash.c from the busybox package into
u-boot.  If you have an extremely limited amount of math, it can be
done with trivial comparison logic already available in hush.

btw, u-boot users and developers should start prepending new hex values
with "0x", btw.

Kim




More information about the U-Boot mailing list