metalsvm/tools/bootinfo.sh
2011-06-27 11:39:01 +02:00

39 lines
605 B
Bash
Executable file

#!/bin/sh
#
IMAGESIZE=$(stat -c%s "$2")
NCORES=$3
ORG=0x80000
echo "[BITS 16]"
echo "SECTION .data"
echo "ORG $ORG"
echo "addr DD $1 ; start addresss of the initrd"
echo "size DD $IMAGESIZE ; size of the initrd"
shift
shift
shift
ARGC=`expr $# + 2`
echo "argc DD $ARGC"
echo "argv DD Largv"
echo "Largv EQU \$"
echo -n " DD name, ncores"
for i in $*
do
echo -n ", L$i"
done
echo ""
echo "name EQU \$"
echo " DB \"MetalSVM\", 0"
echo "ncores EQU \$"
echo " DB \"$NCORES\", 0"
for i in $*
do
echo "L$i EQU \$"
echo " DB \"$i\", 0"
done
echo "gap:"
echo "TIMES 4096-(\$-\$\$) DB 0"