public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* FDC motor left on
@ 2003-10-03 17:25 Richard B. Johnson
  2003-10-03 23:58 ` Dave Jones
  0 siblings, 1 reply; 15+ messages in thread
From: Richard B. Johnson @ 2003-10-03 17:25 UTC (permalink / raw)
  To: Linux kernel

In linux-2.4.22 and earlier, if there is no FDC driver installed,
the FDC motor may continue to run after boot if the motor was
started as part of the BIOS boot sequence.
This patch turns OFF the motor once Linux gets control.


--- linux-2.4.22/arch/i386/boot/setup.S.orig	Fri Aug  2 20:39:42 2002
+++ linux-2.4.22/arch/i386/boot/setup.S	Fri Oct  3 11:50:43 2003
@@ -59,6 +59,8 @@
 #define SIG1	0xAA55
 #define SIG2	0x5A5A

+FDC_MOTOR = 0x3f2
+FDC_MOTON = 0x10
 INITSEG  = DEF_INITSEG		# 0x9000, we move boot here, out of the way
 SYSSEG   = DEF_SYSSEG		# 0x1000, system loaded at 0x10000 (65536).
 SETUPSEG = DEF_SETUPSEG		# 0x9020, this is the current segment
@@ -776,6 +778,12 @@

 	movb	$0xFB, %al			# mask all irq's but irq2 which
 	outb	%al, $0x21			# is cascaded
+
+	movl	$FDC_MOTOR, %edx		# FDC motor control
+	inb	%dx, %al			# Get what's there
+	andb	$~FDC_MOTON, %al		# Reset motor bit
+	outb	%al, %dx			# Turn OFF motor
+

 # Well, that certainly wasn't fun :-(. Hopefully it works, and we don't
 # need no steenking BIOS anyway (except for the initial loading :-).



Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: FDC motor left on
@ 2003-10-04 13:56 Mikael Pettersson
  0 siblings, 0 replies; 15+ messages in thread
From: Mikael Pettersson @ 2003-10-04 13:56 UTC (permalink / raw)
  To: davej, root; +Cc: linux-kernel

On Sat, 4 Oct 2003 00:58:02 +0100, Dave Jones wrote:
>On Fri, Oct 03, 2003 at 01:25:30PM -0400, Richard B. Johnson wrote:
> > In linux-2.4.22 and earlier, if there is no FDC driver installed,
> > the FDC motor may continue to run after boot if the motor was
> > started as part of the BIOS boot sequence.
> > This patch turns OFF the motor once Linux gets control.
> > 
> > 
> > --- linux-2.4.22/arch/i386/boot/setup.S.orig	Fri Aug  2 20:39:42 2002
> > +++ linux-2.4.22/arch/i386/boot/setup.S	Fri Oct  3 11:50:43 2003
> > @@ -59,6 +59,8 @@
>
>Does this mean the 'kill_motor' function in bootsect.S isn't doing
>what it should be? If so, maybe that needs fixing instead of turning
>it off in two places ?

It's my understanding that bootsect.S:kill_motor is part of
the kernel's old builtin boot-from-floppy code, and that it
doesn't run when some other boot loader loaded the kernel.
(And it shouldn't have to.)

The workaround if you have a buggy BIOS or external loader
is to configure BLK_DEV_FD as a built-in. I do that anyway
for other reasons (to avoid an unresolved module autoloading
failure in some cases; it's in RH bugzilla somewhere).

/Mikael

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-10-06 16:47 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-03 17:25 FDC motor left on Richard B. Johnson
2003-10-03 23:58 ` Dave Jones
2003-10-06 12:42   ` Richard B. Johnson
2003-10-06 12:50     ` Maciej W. Rozycki
2003-10-06 12:59     ` Mikael Pettersson
2003-10-06 13:58       ` Richard B. Johnson
2003-10-06 14:25         ` John Bradford
2003-10-06 15:09           ` Richard B. Johnson
2003-10-06 15:49             ` Maciej W. Rozycki
2003-10-06 16:17               ` Richard B. Johnson
2003-10-06 16:46                 ` Maciej W. Rozycki
2003-10-06 16:06             ` John Bradford
2003-10-06 16:22               ` Richard B. Johnson
2003-10-06 16:41                 ` John Bradford
  -- strict thread matches above, loose matches on Subject: below --
2003-10-04 13:56 Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox