Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Nov 2003 00:16:52 +0100 (CET)
From:      Oliver Lehmann <oliver@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Oliver Lehmann <oliver@FreeBSD.org>
Subject:   alpha/59026: re-add Floppy-Dtectection-Support for FreeBSD/alpha
Message-ID:  <200311062316.hA6NGqE1027400@kartoffel.salatschuessel.net>
Resent-Message-ID: <200311062320.hA6NK9M4040422@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         59026
>Category:       alpha
>Synopsis:       re-add Floppy-Dtectection-Support for FreeBSD/alpha
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    freebsd-alpha
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 06 15:20:08 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Oliver Lehmann
>Release:        FreeBSD 4.9-RC i386
>Organization:
>Environment:

	FreeBSD 5.1-p10 alpha
	(patch is made against HEAD file)

>Description:
To get back a working and floppydrive detection on FreeBSD/alpha:

I moved in fd_probe() 
	if (fd->type == FDT_NONE && (fd->fdu == 0 || fd->fdu == 1)) {
out of the
#if defined(__i386__) || defined(__amd64__)
block and created an #else section (like it allready was in RELENG_4!)
where the fd->type is set to 144 by force.

Why not just re-create the #else block? Why moving the if statement out of
the #ifdef block? Doing it that way, it's still possible to set
hint.fd.0.flags for example to 3 (720KB Floppy), and only set the 1.44M
type as a fallback when flags is NULL (FDT_NONE) which means in that case,
hint.fd.0.flags isn't defined. (Because we don't query the "BIOS" as we do
it for x86 to get the info what kind of floppy is attached to fdc.)

	before:

orm0: <Option ROM> at iomem 0xc0000-0xc7fff on isa0
fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> at port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on isa0
fdc0: interrupting at ISA irq 6
atkbdc0: <Keyboard controller (i8042)> at port 0x64,0x60 on isa0


	after:

orm0: <Option ROM> at iomem 0xc0000-0xc7fff on isa0
fdc0: <Enhanced floppy controller (i82077, NE72065 or clone)> at port 0x3f7,0x3f0-0x3f5 irq 6 drq 2 on isa0
fdc0: interrupting at ISA irq 6
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <Keyboard controller (i8042)> at port 0x64,0x60 on isa0


>How-To-Repeat:
	make kernel
	<reboot>
	fdc gets detected, but no fd%d
>Fix:

	

--- src::sys::isa::fd.c begins here ---
--- src/sys/isa/fd.c.orig	Thu Oct 23 07:52:52 2003
+++ src/sys/isa/fd.c	Tue Nov  4 20:05:13 2003
@@ -1204,6 +1204,8 @@
 	fd->flags = FD_UA;	/* make sure fdautoselect() will be called */
 
 	fd->type = FD_DTYPE(flags);
+
+	if (fd->type == FDT_NONE && (fd->fdu == 0 || fd->fdu == 1)) {
 /*
  * XXX I think using __i386__ is wrong here since we actually want to probe
  * for the machine type, not the CPU type (so non-PC arch's like the PC98 will
@@ -1211,7 +1213,6 @@
  * == i386 breaks the test on FreeBSD/Alpha.
  */
 #if defined(__i386__) || defined(__amd64__)
-	if (fd->type == FDT_NONE && (fd->fdu == 0 || fd->fdu == 1)) {
 		/* Look up what the BIOS thinks we have. */
 		if (fd->fdu == 0) {
 			if ((fdc->flags & FDC_ISPCMCIA))
@@ -1229,8 +1230,11 @@
 		}
 		if (fd->type == FDT_288M_1)
 			fd->type = FDT_288M;
-	}
+#else
+		fd->type = FDT_144M;
 #endif /* __i386__ || __amd64__ */
+	}
+
 	/* is there a unit? */
 	if (fd->type == FDT_NONE)
 		return (ENXIO);
--- src::sys::isa::fd.c ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311062316.hA6NGqE1027400>