diff options
-rw-r--r-- | sys/conf/NOTES | 9 | ||||
-rw-r--r-- | sys/conf/options.i386 | 5 | ||||
-rw-r--r-- | sys/dev/fdc/fdc.c | 31 | ||||
-rw-r--r-- | sys/i386/conf/LINT | 9 | ||||
-rw-r--r-- | sys/i386/conf/NOTES | 9 | ||||
-rw-r--r-- | sys/i386/conf/options.i386 | 5 | ||||
-rw-r--r-- | sys/i386/isa/fd.c | 31 | ||||
-rw-r--r-- | sys/isa/fd.c | 31 |
8 files changed, 95 insertions, 35 deletions
diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 669dcff..a75c0a1 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.364 1997/09/10 03:07:13 peter Exp $ +# $Id: LINT,v 1.365 1997/09/14 21:45:01 jmg Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -794,6 +794,13 @@ device wcd0 # controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr # +# FDC_DEBUG enables floppy debugging. Since the debug output is huge, you +# gotta turn it actually on by setting the variable fd_debug with DDB, +# however. +options FDC_DEBUG +# This option is undocumented on purpose. +options FDC_PRINT_BOGUS_CHIPTYPE +# # Activate this line instead of the fdc0 line above if you happen to # have an Insight floppy tape. Probing them proved to be dangerous # for people with floppy disks only, so it's "hidden" behind a flag: diff --git a/sys/conf/options.i386 b/sys/conf/options.i386 index db4591a..f696dfa 100644 --- a/sys/conf/options.i386 +++ b/sys/conf/options.i386 @@ -1,4 +1,4 @@ -# $Id: options.i386,v 1.57 1997/08/31 23:08:19 bde Exp $ +# $Id: options.i386,v 1.58 1997/09/04 23:03:11 yokota Exp $ BOUNCEPAGES opt_bounce.h USER_LDT @@ -100,3 +100,6 @@ VISUAL_USERCONFIG opt_userconfig.h USERCONFIG_BOOT opt_userconfig.h EISA_SLOTS opt_eisa.h + +FDC_DEBUG opt_fdc.h +FDC_PRINT_BOGUS_CHIPTYPE opt_fdc.h diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 4754895..99c4d21 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.99 1997/03/24 11:23:43 bde Exp $ + * $Id: fd.c,v 1.100 1997/07/20 14:09:54 bde Exp $ * */ @@ -52,6 +52,7 @@ #undef NFDC #endif #include "fd.h" +#include "opt_fdc.h" #if NFDC > 0 @@ -233,7 +234,7 @@ static int fdformat(dev_t, struct fd_formb *, struct proc *); #define MOTORWAIT 10 #define IOTIMEDOUT 11 -#ifdef DEBUG +#ifdef FDC_DEBUG static char const * const fdstates[] = { "DEVIDLE", @@ -254,10 +255,10 @@ static char const * const fdstates[] = static int volatile fd_debug = 0; #define TRACE0(arg) if(fd_debug) printf(arg) #define TRACE1(arg1, arg2) if(fd_debug) printf(arg1, arg2) -#else /* DEBUG */ +#else /* FDC_DEBUG */ #define TRACE0(arg) #define TRACE1(arg1, arg2) -#endif /* DEBUG */ +#endif /* FDC_DEBUG */ /* autoconfig structure */ @@ -541,23 +542,33 @@ fdattach(struct isa_device *dev) if (ic_type == 0 && fd_cmd(fdcu, 1, NE7CMD_VERSION, 1, &ic_type) == 0) { +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("fdc%d: ", fdcu); +#endif ic_type = (u_char)ic_type; switch( ic_type ) { case 0x80: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("NEC 765\n"); +#endif fdc->fdct = FDC_NE765; break; case 0x81: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("Intel 82077\n"); +#endif fdc->fdct = FDC_I82077; break; case 0x90: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("NEC 72065B\n"); +#endif fdc->fdct = FDC_NE72065; break; default: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("unknown IC type %02x\n", ic_type); +#endif fdc->fdct = FDC_UNKNOWN; break; } @@ -853,13 +864,13 @@ in_fdc(fdcu_t fdcu) return fdc_err(fdcu, "ready for output in input\n"); if (j <= 0) return fdc_err(fdcu, bootverbose? "input ready timeout\n": 0); -#ifdef DEBUG +#ifdef FDC_DEBUG i = inb(baseport+FDDATA); TRACE1("[FDDATA->0x%x]", (unsigned char)i); return(i); -#else +#else /* !FDC_DEBUG */ return inb(baseport+FDDATA); -#endif +#endif /* FDC_DEBUG */ } /* @@ -876,17 +887,17 @@ fd_in(fdcu_t fdcu, int *ptr) return fdc_err(fdcu, "ready for output in input\n"); if (j <= 0) return fdc_err(fdcu, bootverbose? "input ready timeout\n": 0); -#ifdef DEBUG +#ifdef FDC_DEBUG i = inb(baseport+FDDATA); TRACE1("[FDDATA->0x%x]", (unsigned char)i); *ptr = i; return 0; -#else +#else /* !FDC_DEBUG */ i = inb(baseport+FDDATA); if (ptr) *ptr = i; return 0; -#endif +#endif /* FDC_DEBUG */ } int diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT index 669dcff..a75c0a1 100644 --- a/sys/i386/conf/LINT +++ b/sys/i386/conf/LINT @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.364 1997/09/10 03:07:13 peter Exp $ +# $Id: LINT,v 1.365 1997/09/14 21:45:01 jmg Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -794,6 +794,13 @@ device wcd0 # controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr # +# FDC_DEBUG enables floppy debugging. Since the debug output is huge, you +# gotta turn it actually on by setting the variable fd_debug with DDB, +# however. +options FDC_DEBUG +# This option is undocumented on purpose. +options FDC_PRINT_BOGUS_CHIPTYPE +# # Activate this line instead of the fdc0 line above if you happen to # have an Insight floppy tape. Probing them proved to be dangerous # for people with floppy disks only, so it's "hidden" behind a flag: diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 669dcff..a75c0a1 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -2,7 +2,7 @@ # LINT -- config file for checking all the sources, tries to pull in # as much of the source tree as it can. # -# $Id: LINT,v 1.364 1997/09/10 03:07:13 peter Exp $ +# $Id: LINT,v 1.365 1997/09/14 21:45:01 jmg Exp $ # # NB: You probably don't want to try running a kernel built from this # file. Instead, you should start from GENERIC, and add options from @@ -794,6 +794,13 @@ device wcd0 # controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr # +# FDC_DEBUG enables floppy debugging. Since the debug output is huge, you +# gotta turn it actually on by setting the variable fd_debug with DDB, +# however. +options FDC_DEBUG +# This option is undocumented on purpose. +options FDC_PRINT_BOGUS_CHIPTYPE +# # Activate this line instead of the fdc0 line above if you happen to # have an Insight floppy tape. Probing them proved to be dangerous # for people with floppy disks only, so it's "hidden" behind a flag: diff --git a/sys/i386/conf/options.i386 b/sys/i386/conf/options.i386 index db4591a..f696dfa 100644 --- a/sys/i386/conf/options.i386 +++ b/sys/i386/conf/options.i386 @@ -1,4 +1,4 @@ -# $Id: options.i386,v 1.57 1997/08/31 23:08:19 bde Exp $ +# $Id: options.i386,v 1.58 1997/09/04 23:03:11 yokota Exp $ BOUNCEPAGES opt_bounce.h USER_LDT @@ -100,3 +100,6 @@ VISUAL_USERCONFIG opt_userconfig.h USERCONFIG_BOOT opt_userconfig.h EISA_SLOTS opt_eisa.h + +FDC_DEBUG opt_fdc.h +FDC_PRINT_BOGUS_CHIPTYPE opt_fdc.h diff --git a/sys/i386/isa/fd.c b/sys/i386/isa/fd.c index 4754895..99c4d21 100644 --- a/sys/i386/isa/fd.c +++ b/sys/i386/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.99 1997/03/24 11:23:43 bde Exp $ + * $Id: fd.c,v 1.100 1997/07/20 14:09:54 bde Exp $ * */ @@ -52,6 +52,7 @@ #undef NFDC #endif #include "fd.h" +#include "opt_fdc.h" #if NFDC > 0 @@ -233,7 +234,7 @@ static int fdformat(dev_t, struct fd_formb *, struct proc *); #define MOTORWAIT 10 #define IOTIMEDOUT 11 -#ifdef DEBUG +#ifdef FDC_DEBUG static char const * const fdstates[] = { "DEVIDLE", @@ -254,10 +255,10 @@ static char const * const fdstates[] = static int volatile fd_debug = 0; #define TRACE0(arg) if(fd_debug) printf(arg) #define TRACE1(arg1, arg2) if(fd_debug) printf(arg1, arg2) -#else /* DEBUG */ +#else /* FDC_DEBUG */ #define TRACE0(arg) #define TRACE1(arg1, arg2) -#endif /* DEBUG */ +#endif /* FDC_DEBUG */ /* autoconfig structure */ @@ -541,23 +542,33 @@ fdattach(struct isa_device *dev) if (ic_type == 0 && fd_cmd(fdcu, 1, NE7CMD_VERSION, 1, &ic_type) == 0) { +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("fdc%d: ", fdcu); +#endif ic_type = (u_char)ic_type; switch( ic_type ) { case 0x80: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("NEC 765\n"); +#endif fdc->fdct = FDC_NE765; break; case 0x81: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("Intel 82077\n"); +#endif fdc->fdct = FDC_I82077; break; case 0x90: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("NEC 72065B\n"); +#endif fdc->fdct = FDC_NE72065; break; default: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("unknown IC type %02x\n", ic_type); +#endif fdc->fdct = FDC_UNKNOWN; break; } @@ -853,13 +864,13 @@ in_fdc(fdcu_t fdcu) return fdc_err(fdcu, "ready for output in input\n"); if (j <= 0) return fdc_err(fdcu, bootverbose? "input ready timeout\n": 0); -#ifdef DEBUG +#ifdef FDC_DEBUG i = inb(baseport+FDDATA); TRACE1("[FDDATA->0x%x]", (unsigned char)i); return(i); -#else +#else /* !FDC_DEBUG */ return inb(baseport+FDDATA); -#endif +#endif /* FDC_DEBUG */ } /* @@ -876,17 +887,17 @@ fd_in(fdcu_t fdcu, int *ptr) return fdc_err(fdcu, "ready for output in input\n"); if (j <= 0) return fdc_err(fdcu, bootverbose? "input ready timeout\n": 0); -#ifdef DEBUG +#ifdef FDC_DEBUG i = inb(baseport+FDDATA); TRACE1("[FDDATA->0x%x]", (unsigned char)i); *ptr = i; return 0; -#else +#else /* !FDC_DEBUG */ i = inb(baseport+FDDATA); if (ptr) *ptr = i; return 0; -#endif +#endif /* FDC_DEBUG */ } int diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 4754895..99c4d21 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -43,7 +43,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.99 1997/03/24 11:23:43 bde Exp $ + * $Id: fd.c,v 1.100 1997/07/20 14:09:54 bde Exp $ * */ @@ -52,6 +52,7 @@ #undef NFDC #endif #include "fd.h" +#include "opt_fdc.h" #if NFDC > 0 @@ -233,7 +234,7 @@ static int fdformat(dev_t, struct fd_formb *, struct proc *); #define MOTORWAIT 10 #define IOTIMEDOUT 11 -#ifdef DEBUG +#ifdef FDC_DEBUG static char const * const fdstates[] = { "DEVIDLE", @@ -254,10 +255,10 @@ static char const * const fdstates[] = static int volatile fd_debug = 0; #define TRACE0(arg) if(fd_debug) printf(arg) #define TRACE1(arg1, arg2) if(fd_debug) printf(arg1, arg2) -#else /* DEBUG */ +#else /* FDC_DEBUG */ #define TRACE0(arg) #define TRACE1(arg1, arg2) -#endif /* DEBUG */ +#endif /* FDC_DEBUG */ /* autoconfig structure */ @@ -541,23 +542,33 @@ fdattach(struct isa_device *dev) if (ic_type == 0 && fd_cmd(fdcu, 1, NE7CMD_VERSION, 1, &ic_type) == 0) { +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("fdc%d: ", fdcu); +#endif ic_type = (u_char)ic_type; switch( ic_type ) { case 0x80: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("NEC 765\n"); +#endif fdc->fdct = FDC_NE765; break; case 0x81: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("Intel 82077\n"); +#endif fdc->fdct = FDC_I82077; break; case 0x90: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("NEC 72065B\n"); +#endif fdc->fdct = FDC_NE72065; break; default: +#ifdef FDC_PRINT_BOGUS_CHIPTYPE printf("unknown IC type %02x\n", ic_type); +#endif fdc->fdct = FDC_UNKNOWN; break; } @@ -853,13 +864,13 @@ in_fdc(fdcu_t fdcu) return fdc_err(fdcu, "ready for output in input\n"); if (j <= 0) return fdc_err(fdcu, bootverbose? "input ready timeout\n": 0); -#ifdef DEBUG +#ifdef FDC_DEBUG i = inb(baseport+FDDATA); TRACE1("[FDDATA->0x%x]", (unsigned char)i); return(i); -#else +#else /* !FDC_DEBUG */ return inb(baseport+FDDATA); -#endif +#endif /* FDC_DEBUG */ } /* @@ -876,17 +887,17 @@ fd_in(fdcu_t fdcu, int *ptr) return fdc_err(fdcu, "ready for output in input\n"); if (j <= 0) return fdc_err(fdcu, bootverbose? "input ready timeout\n": 0); -#ifdef DEBUG +#ifdef FDC_DEBUG i = inb(baseport+FDDATA); TRACE1("[FDDATA->0x%x]", (unsigned char)i); *ptr = i; return 0; -#else +#else /* !FDC_DEBUG */ i = inb(baseport+FDDATA); if (ptr) *ptr = i; return 0; -#endif +#endif /* FDC_DEBUG */ } int |