linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@csd.uu.se>
To: alan@lxorguk.ukuu.org.uk
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] arch/i386/boot/bootsect.S incompatibility problem
Date: Sat, 27 Oct 2001 16:10:59 +0200 (MET DST)	[thread overview]
Message-ID: <200110271410.QAA02345@harpo.it.uu.se> (raw)

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

                 reply	other threads:[~2001-10-27 14:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200110271410.QAA02345@harpo.it.uu.se \
    --to=mikpe@csd.uu.se \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).