lkml.org 
[lkml]   [2001]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] arch/i386/boot/bootsect.S incompatibility problem
Alan,

The patch below fixes an incompatibility in arch/i386/boot/bootsect.S,
which kills Linux' floppy driver on some recent motherboards (e.g. my
new ASUS P4T-E Pentium4/I850/S478 mb).

After reading the kernel image, bootsect.S calls kill_motor to stop
the floppy drive, which it does by poking port 0x3f2. On the P4T-E,
this locks up the FDC, casing drivers/block/floppy to report:

Floppy drive(s): fd0 is 1.44M
// long delay here
floppy0: no floppy controllers found

drivers/block/floppy.c:reset_fdc() knows about different vintages of
FDCs, and uses a different method for non-antique FDCs (poking port
0x3f4 instead). If I use that method in bootsect.S, then the FDC doesn't
hang and the floppy driver can identify and use it properly.

However, instead of poking an I/O port there is a BIOS call to reset
the FDC: bootsect.S itself uses that call further up, so my patch simply
replaces the broken I/O port poke with that BIOS call. Tested on a
number of different boxes here, with no breakage observed.

/Mikael

--- linux-2.4.13-ac2/arch/i386/boot/bootsect.S.~1~ Sun Sep 23 21:06:30 2001
+++ linux-2.4.13-ac2/arch/i386/boot/bootsect.S Sat Oct 27 13:35:13 2001
@@ -395,9 +395,15 @@
# NOTE: Doesn't save %ax or %dx; do it yourself if you need to.

kill_motor:
+#if 1
+ xorw %ax, %ax # reset FDC
+ xorb %dl, %dl
+ int $0x13
+#else
movw $0x3f2, %dx
xorb %al, %al
outb %al, %dx
+#endif
ret

sectors: .word 0
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:11    [W:0.042 / U:3.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site