# HG changeset patch # User Pascal Bellard # Date 1287068892 -7200 # Node ID 39cb6f60c89ec246d8ae457de63c4b5ede46f145 # Parent 3bff7f88b1c896e9c447db35745c75cebceedcc6 linux/bootloader.sh: fix signed 16bits diff -r 3bff7f88b1c8 -r 39cb6f60c89e linux/stuff/bootloader.sh --- a/linux/stuff/bootloader.sh Thu Oct 14 13:41:19 2010 +0200 +++ b/linux/stuff/bootloader.sh Thu Oct 14 17:08:12 2010 +0200 @@ -10,8 +10,10 @@ { cat < /dev/null [ -n "$DEBUG" ] && printf "store16(%04X) = %04X\n" $1 $2 1>&2 @@ -76,6 +87,7 @@ floppyset() { # bzImage offsets + CylinderCount=496 SetupSzOfs=497 FlagsOfs=498 SyssizeOfs=500 @@ -118,19 +130,24 @@ setupszb=$(( $setupsz & 255 )) dd if=$KERNEL bs=512 skip=1 count=$setupszb 2> /dev/null >> $bs + if [ -n "$TRACKS" ]; then + [ -n "$DEBUG" ] && echo -n "--tracks " 1>&2 + n=$(getlong $CylinderCount $bs) + store16 $CylinderCount $(( ($n & -256) + $TRACKS )) $bs + fi if [ -n "$FLAGS" ]; then [ -n "$DEBUG" ] && echo -n "--flags " 1>&2 - store16 $FlagsOfs $(( $FLAGS )) $bs + store16 $FlagsOfs $FLAGS $bs fi if [ -n "$VIDEO" ]; then [ -n "$DEBUG" ] && echo -n "--video " 1>&2 - store16 $VideoModeOfs $(( $VIDEO )) $bs + store16 $VideoModeOfs $VIDEO $bs fi if [ -n "$RDEV" ]; then [ -n "$DEBUG" ] && echo -n "--rdev " 1>&2 n=$(stat -c '0x%02t%02T' $RDEV 2> /dev/null) [ -n "$n" ] || n=$RDEV - store16 $RootDevOfs $(( $n )) $bs + store16 $RootDevOfs $n $bs fi # Store cmdline after setup @@ -186,6 +203,10 @@ rm -f $bs } +if [ "$FORMAT" == "0" ]; then # unsplitted + floppyset > $PREFIX + exit +fi floppyset | split -b ${FORMAT}k /dev/stdin floppy$$ i=1 ls floppy$$* | while read file ; do