[comp.os.minix] 1.3c bootblok.s broken +FIX

jonathan@comp.vuw.ac.nz (Jonathan) (10/06/88)

In article <1454@ast.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes:
>In article <14243@comp.vuw.ac.nz> jonathan@comp.vuw.ac.nz (Jonathan) writes:
>>	(10) the new bootblok.s seems broken.  
>Good grief.  I have made up the 1.3 diskettes and put them in a box full
>of styrofoam and sealed it and am waiting to send it off.  I am not
>enthusiastic about starting all over, but this bug, if true, is deadly.

A Minix kernel built from bootblok.s as posted in 1.3c will *never*
boot off a 360k floppy.  A context diff fixing this is included.
I've tested it result on both 1.2M and 360k.

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	bootblok.cdiff
# This archive created: Thu Oct  6 16:45:04 1988
# By:	Jonathan ()
export PATH; PATH=/bin:$PATH
echo shar: extracting "'bootblok.cdiff'" '(347 characters)'
if test -f 'bootblok.cdiff'
then
	echo shar: will not over-write existing file "'bootblok.cdiff'"
else
sed 's/^X//' << \SHAR_EOF > 'bootblok.cdiff'
X*** /usr/src/minix/tools/bootblok-1.3c	Sun Oct  2 13:13:04 1988
X--- bootblok.s	Thu Oct  6 16:23:22 1988
X***************
X*** 136,142 ****
X  	mov	DSKBASE,ax
X  	seg	es
X  	mov	DSKBASE+2,dx
X! 	int	0x13		| diskette reset
X  
X  L1:
X  
X--- 136,143 ----
X  	mov	DSKBASE,ax
X  	seg	es
X  	mov	DSKBASE+2,dx
X! 	xor	ax,ax		| diskette reset
X! 	int	0x13
X  
X  L1:
X  
SHAR_EOF
if test 347 -ne "`wc -c < 'bootblok.cdiff'`"
then
	echo shar: error transmitting "'bootblok.cdiff'" '(should have been 347 characters)'
fi
fi # end of overwriting check
#	End of shell archive
exit 0
-- 
-----------------------------------------------------------------------------
sane mailers: jonathan@comp.vuw.ac.nz |    Industrial democracy:
UUCP path: ...!uunet!vuwcomp!jonathan |           One factory, one vote!

ast@cs.vu.nl (Andy Tanenbaum) (10/10/88)

In article <14265@comp.vuw.ac.nz> jonathan@comp.vuw.ac.nz (Jonathan) writes:
>A Minix kernel built from bootblok.s as posted in 1.3c will *never*
>boot off a 360k floppy.  A context diff fixing this is included.
>I've tested it result on both 1.2M and 360k.

I have tried this fix also, and it seems to work.  It looks like ax was not
0 at the time of the call to the BIOS to reset, so it didn't reset.  I hope
bootblok.s now works everywhere.  Feedback is definitely welcome.  I have to
open the box full of styrofoam now, so let's see if I can get it right this
time.  Many thanks to Jonathan for the excellent detective work.

Sometimes we are all so used to USENET technology that we forget how amazing
it really is.  Try this on your mother some time: "A guy in Holland wrote some
software that I use on my computer, and he found a bug in it.  He announced
this on a computer network, and two days later another guy in New Zealand
found it and told me and 10,000 other interested people how to fix it.  Of the
100,000 lines in the software, there was one line missing."  I tried to describe
USENET to my father once, and his reaction was: "What century am I living in?"

In case anyone missed Jonathan's fix, it is listed below.

Andy Tanenbaum (ast@cs.vu.nl)



: This is a shar archive.  Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
: --------------------------- cut here --------------------------
PATH=/bin:/usr/bin:/usr/ucb
echo Extracting 'bootblok.cdif'
sed 's/^X//' > 'bootblok.cdif' << '+ END-OF-FILE ''bootblok.cdif'
X*** bootblok.old	Mon Oct 10 11:17:14 1988
X--- bootblok.s	Mon Oct 10 11:07:16 1988
X***************
X*** 136,142 ****
X  	mov	DSKBASE,ax
X  	seg	es
X  	mov	DSKBASE+2,dx
X! 	int	0x13		| diskette reset
X  
X  L1:
X  
X--- 136,143 ----
X  	mov	DSKBASE,ax
X  	seg	es
X  	mov	DSKBASE+2,dx
X! 	xor	ax,ax		| diskette reset
X! 	int	0x13
X  
X  L1:
X  
+ END-OF-FILE bootblok.cdif
chmod 'u=rw,g=r,o=r' 'bootblok.cdif'
set `wc -c 'bootblok.cdif'`
count=$1
case $count in
325)	:;;
*)	echo 'Bad character count in ''bootblok.cdif' >&2
		echo 'Count should be 325' >&2
esac
exit 0