skrom
1.17 KB
#!/bin/sh
###### Code in rom file #######
_codeSegmentRomStart=`nm -n gng | grep _codeSegmentRomStart | sed -e s/" A.*$"//`
_codeSegmentRomEnd=`nm -n gng | grep _codeSegmentRomEnd | sed -e s/" A.*$"//`
##### Code read to memory #######
_codeSegmentTextStart=`nm -n gng | grep _codeSegmentTextStart | sed -e s/" A.*$"//`
_codeSegmentTextEnd=`nm -n gng | grep _codeSegmentTextEnd | sed -e s/" A.*$"//`
###### BSS in memory which need to init to zero #####
_codeSegmentBssStart=`nm -n gng | grep _codeSegmentBssStart | sed -e s/" A.*$"//`
_codeSegmentBssEnd=`nm -n gng | grep _codeSegmentBssEnd | sed -e s/" A.*$"//`
###### DATA in memory which need to be invalidate #####
_codeSegmentDataStart=`nm -n gng | grep _codeSegmentDataStart | sed -e s/" A.*$"//`
_codeSegmentDataEnd=`nm -n gng | grep _codeSegmentDataEnd | sed -e s/" A.*$"//`
echo "$_codeSegmentRomStart" > tmp.$$
echo "$_codeSegmentRomEnd" >> tmp.$$
echo "$_codeSegmentTextStart" >> tmp.$$
echo "$_codeSegmentTextEnd" >> tmp.$$
echo "$_codeSegmentBssStart" >> tmp.$$
echo "$_codeSegmentBssEnd" >> tmp.$$
echo "$_codeSegmentDataStart" >> tmp.$$
echo "$_codeSegmentDataEnd" >> tmp.$$
./hex2dat tmp.$$ $2
cat $1 >> $2
rm -rf tmp.$$