Re: [FIX] 2.3.28 broke `make bzdisk'

Chris Noe (stiker@northlink.com)
Sat, 13 Nov 1999 18:38:13 -0500 (EST)


On Sun, 14 Nov 1999, Mikael Pettersson wrote:

> There are several workarounds. One is to remove the redundant
> `pushw %dx'/`popw %dx' instructions from kill_motor. Another is
> to use my patch which shifts the burden to the Makefile.

I thought that that change had already been included, but I seem to
have remembered incorrectly! My 2.9.5 puts a few less prefix bytes in
the bootcode (vs. 2.9.1) and therefore the one byte over was reclaimed
somewhere else, masking the problem. Bummer.

I do like the fact that your solution keeps a few more bytes out of the
bootcode; I think we'll go with it. The original motivation for changing
how bootsect_kludge was called was to kill the fact that the address was
hardcoded in the Makefile. Your way does that without bloating the
bootsector.

Thanks.

Patch attached is Mikael's with an additional hunk that kills the
unneeded push/pop %dx in kill_motor. Should fix everything wrong with the
simple bootsect loader (at the moment :).

(I'm trying to see how we can get rid of bootsect_kludge altogether, too.
Stay tuned.)

Chris Noe
(stiker@northlink.com)

diff -u --recursive --new-file linux-2.3.26/arch/i386/boot/Makefile linux/arch/i386/boot/Makefile
--- linux-2.3.26/arch/i386/boot/Makefile Sat Nov 13 17:37:58 1999
+++ linux/arch/i386/boot/Makefile Sat Nov 13 17:39:53 1999
@@ -51,8 +51,11 @@
bootsect.s: bootsect.S Makefile $(BOOT_INCL)
$(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@

-bbootsect: bbootsect.o bsetup.o
- $(LD) -Ttext 0x0 -R bsetup.o -s -oformat binary $< -o $@
+bbootsect: bbootsect.o bbootsect_kludge.o
+ $(LD) -Ttext 0x0 -R bbootsect_kludge.o -s -oformat binary $< -o $@
+
+bbootsect_kludge.o: bbootsect.o bsetup.o
+ $(LD) -r $^ -o $@

bbootsect.o: bbootsect.s
$(AS) -o $@ $<
@@ -84,4 +87,5 @@
rm -f tools/build
rm -f setup bootsect zImage compressed/vmlinux.out
rm -f bsetup bbootsect bzImage compressed/bvmlinux.out
+ rm -f bbootsect_kludge.o
@$(MAKE) -C compressed clean
diff -u --recursive --new-file linux-2.3.26/arch/i386/boot/bootsect.S linux/arch/i386/boot/bootsect.S
--- linux-2.3.26/arch/i386/boot/bootsect.S Wed Nov 10 19:28:49 1999
+++ linux/arch/i386/boot/bootsect.S Sat Nov 13 17:39:14 1999
@@ -398,11 +398,9 @@
# don't have to worry about it later.

kill_motor:
- pushw %dx
movw $0x3f2, %dx
xorb %al, %al
outb %al, %dx
- popw %dx
ret

sectors: .word 0

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/