Date: Tue, 4 Nov 2003 20:42:46 +0100 From: Oliver Lehmann <lehmann@ans-netz.de> To: alpha@freebsd.org Cc: joerg@freebsd.org Subject: Re: Floppy drive not found by RELENG_5_1 Message-ID: <20031104204246.3c45d326.lehmann@ans-netz.de> In-Reply-To: <20031104190230.7ebf3bc5.lehmann@ans-netz.de> References: <20031103210959.58d4afc1.lehmann@ans-netz.de> <xzpn0bcqvj9.fsf@dwp.des.no> <20031104184704.1327aff2.lehmann@ans-netz.de> <20031104190230.7ebf3bc5.lehmann@ans-netz.de>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
Ok,
to get back a working and floppydrive detection on FreeBSD/alpha:
What's about the attached patch?
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 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.)
Greetings, Oliver
--
Oliver Lehmann
@home: lehmann@ans-netz.de
@office: oliver.lehmann@mgi.de
@www: http://www.pofo.de/ | http://wishlist.ans-netz.de/
[-- Attachment #2 --]
--- 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);
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031104204246.3c45d326.lehmann>
