3 # Calculates the size left in ETRAX cache when bootloader is loaded.
6 BOOT_FILE
=`dirname $0`/net
/net.out
7 HEADER_FILE
=`dirname $0`/src
/e100boot.h
9 for FILE
in $BOOT_FILE $HEADER_FILE; do
10 if [ ! -f $FILE ]; then
11 echo "Could not find the file \"$FILE\"!"
16 # The cache size is given in hex
19 BSS_SIZE
=`nm-cris $BOOT_FILE | grep Ebss | cut -d ' ' -f 1 | tr a-f A-F`
21 TEXT_SIZE
=`nm-cris $BOOT_FILE | grep Stext | cut -d ' ' -f 1 | tr a-f A-F`
23 IO_BUF_END
=`grep IO_BUF_END $HEADER_FILE | awk '{ print $3 }' | \
24 cut -d x -f 2 | tr a-f A-F`
26 IO_BUF_START
=`grep IO_BUF_START $HEADER_FILE | awk '{ print $3 }' | \
27 cut -d x -f 2 | tr a-f A-F`
29 FREE_SIZE
=`echo "ibase=16 ; \
31 ($BSS_SIZE - $TEXT_SIZE + $IO_BUF_END - $IO_BUF_START)" | \
34 echo "Free cache size when cbl is loaded will be:"
35 echo -e "\t$FREE_SIZE bytes - size of stack"
37 if [ $FREE_SIZE -lt 0 ]; then
38 echo "Bootloader is too large! You will have to do some optimizing..."
This page took 0.040574 seconds and 5 git commands to generate.