From owner-freebsd-hackers Thu Sep 11 05:30:34 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id FAA18268 for hackers-outgoing; Thu, 11 Sep 1997 05:30:34 -0700 (PDT) Received: from bmggwy1.bmg.gv.at (bmggwy1.bmg.gv.at [194.232.79.10]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id FAA18263 for ; Thu, 11 Sep 1997 05:30:29 -0700 (PDT) Received: by bmggwy1.bmg.gv.at; (5.65v3.2/1.3/10May95) id AA25521; Thu, 11 Sep 1997 14:34:01 +0200 Received: by fw2.bmg.gv.at; (5.65v3.2/1.3/10May95) id AA30625; Thu, 11 Sep 1997 14:34:09 +0200 Received: from [10.41.0.35] by bmg004.bmg.gv.at (5.65v4.0/1.1.8.2/16Dec96-1116AM) id AA19424; Thu, 11 Sep 1997 14:40:00 +0200 Received: from hugo.bmg.gv.at (hugo.bmg.gv.at [10.41.0.35]) by hugo.bmg.gv.at (8.8.5/8.6.12) with SMTP id OAA01916 for ; Thu, 11 Sep 1997 14:30:15 +0200 (MET DST) Message-Id: X-Mailer: XFMail 1.0 [p0] on FreeBSD X-Priority: 2 (High) Priority: urgent X-Chameleon-Return-To: alex@hugo.bmg.gv.at X-Xfmail-Return-To: alex@hugo.bmg.gv.at Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Mime-Version: 1.0 Date: Thu, 11 Sep 1997 14:02:38 +0200 (MET DST) From: Alexander Hausner To: freebsd-hackers@FreeBSD.ORG Subject: fd.c and Compaq AERO Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Dear All, There is a problem concerning detection of the pcmcia-floppy on compaq aero notebooks. I found some entries in the freebsd-questions archive: >Date: Thu, 17 Aug 1995 16:56:12 -0400 (EDT) >From: John Seamus >To: questions@FreeBSD.ORG >Sender: questions-owner@FreeBSD.ORG >Subject: installing on a laptop > >I want to install freebsd on a compaq contura aero laptop, but have been >having awful luck.. I got release 2.1.0-950726-SNAP from ftp.cdrom.com, >and made a copy of the root and boot disks.. my problem is occuring after >bootup.. due to the odd configuration of the floppy drive on the compaq, >after booting, FreeBSD refuses to see the floppy drive... I set >everything up, and when it goes to read the root disk, it says "Error, no >floppy devices found" or something similar to that error.. I am wondering >if I could possibly put the root disk on my dos partition that I'm >installing from, or if there is some way installing freebsd can be done >on this machine... please respond ASAP! >Pat >On Fri, 5 Jul 1996, Michael Richardson wrote: > >> I managed to get the 2.1-960627-SNAP kernel (boot4) to boot on this system. >> If I add -c to the boot flags, and remove the PCMCIA floppy drive and >> insert my etherlink III card, I can recognize it, partition the hard disk, >> and attempt to install. > >This is going to be the way you'll have to install. If your network has >inet access then you should be able to do an ftp install from >ftp.freebsd.org, or from a mounted cd on a local machine. > >> If I try to install from floppy, (leaving the floppy connected the whole >> time), I am informed that the machine does not have a floppy drive. On boot u p, >> I see fdc0, but no fd0 found. > >Welcome to compaq, the proprietary software company. :( > >Doug White | University of Oregon >Internet: dwhite@resnet.uoregon.edu | Residence Networking Assistant >http://gladstone.uoregon.edu/~dwhite | Computer Science Major The problem is that this kind of drive can't be detected by reading floppy info from CMOS-RAM. I have now fixed this, by modifying fd.c as follows (output of diff -c fd.c.patch fd.c <== from Freebsd-Current): *** fd.c Thu Sep 11 14:01:20 1997 --- fd.c.new Thu Sep 11 13:56:35 1997 *************** *** 13,18 **** --- 13,20 ---- * Copyright (c) 1993, 1994, 1995 by * joerg_wunsch@uriah.sax.de (Joerg Wunsch) * dufault@hda.com (Peter Dufault) + * alex@hugo.bmg.gv.at (Alexander Hausner) minor modifications to support + * compaq aero FDCs * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions *************** *** 43,49 **** * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 ! * $Id: fd.c,v 1.100 1997/07/20 14:09:54 bde Exp $ * */ --- 45,51 ---- * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 ! * $Id: fd.c,v 1.92.2.3 1996/12/21 18:33:43 bde Exp $ * */ *************** *** 59,69 **** #include #include #include ! #include #include #include #include #include #include #include #include --- 61,73 ---- #include #include #include ! #include ! #include #include #include #include #include + #include #include #include #include *************** *** 84,89 **** --- 88,99 ---- #include #endif + /* bit 0 set ==> no CMOS floppy info ==> maybe we are on a compaq aero */ + #define C_AERO_BIT0 1 + + /* bit 1 set ==> FDC is a NEC 72065B ==> maybe we are on a compaq aero */ + #define C_AERO_BIT1 2 + /* misuse a flag to identify format operation */ #define B_FORMAT B_XXX *************** *** 275,281 **** static struct cdevsw fd_cdevsw; static struct bdevsw fd_bdevsw = { Fdopen, fdclose, fdstrategy, fdioctl, /*2*/ ! nodump, nopsize, D_DISK, "fd", &fd_cdevsw, -1 }; static struct isa_device *fdcdevs[NFDC]; --- 285,291 ---- static struct cdevsw fd_cdevsw; static struct bdevsw fd_bdevsw = { Fdopen, fdclose, fdstrategy, fdioctl, /*2*/ ! nodump, nopsize, 0, "fd", &fd_cdevsw, -1 }; static struct isa_device *fdcdevs[NFDC]; *************** *** 464,469 **** --- 474,480 ---- fdattach(struct isa_device *dev) { unsigned fdt; + unsigned c_aero = 0; fdu_t fdu; fdcu_t fdcu = dev->id_unit; fdc_p fdc = fdc_data + fdcu; *************** *** 503,508 **** --- 514,524 ---- /* look up what bios thinks we have */ switch (fdu) { case 0: fdt = (rtcin(RTC_FDISKETTE) & 0xf0); + if (!(fdt || ((rtcin(RTC_FDISKETTE) << 4) & 0xf0))) { + printf("fdc%d: i belive we are on a compaq aero\n", fdcu); + c_aero ^= C_AERO_BIT0; /* maybe we are on a compaq aero */ + fdt = RTCFDT_144M; + } break; case 1: fdt = ((rtcin(RTC_FDISKETTE) << 4) & 0xf0); break; *************** *** 555,560 **** --- 571,577 ---- case 0x90: printf("NEC 72065B\n"); fdc->fdct = FDC_NE72065; + c_aero ^= C_AERO_BIT1; /* compaq aero ==> NEC 72065B */ break; default: printf("unknown IC type %02x\n", ic_type); *************** *** 604,609 **** --- 621,630 ---- set_motor(fdcu, fdsu, TURNOFF); + if ((c_aero & (C_AERO_BIT0 | C_AERO_BIT1)) == C_AERO_BIT0) { + printf("fd%d: wrong FDC for compaq aero ==> floppy disabled!\n", fdcu); + continue; /* no CMOS floppy type info, but FDC isn't */ + } /* a NEC 72065B ==> probably not a compaq aero */ if (st0 & NE7_ST0_EC) /* no track 0 -> no drive present */ continue; Note: you also need to install the latest firmware upgrade on your compaq aero, you can obtain this from www.compaq.com. I have tested this patch to fd.c not only on a compaq aero but also on an AT&T Globalyst Pentium 120 and an ASUS-Board based P166. Thanks! Alex , , /( )` \ \___ / | __________________________ /- _ `-/ ' / \ (/\/ \ \ /\ | FreeBSD | / / | ` \ |a real operating system for | O O ) / | | real users |,, `-^--'`< ' | | ,, (_.) _ ) / \__________________________/ .. `.___/` / `-----' / <----. __ / __ \ <----|====O)))==) \) /=== <----' `--' `.__,' | \ | \ / /\ ______( (_ / \______/ ,' ,-----' | `--{__________) ---------------------------------- E-Mail: Alexander Hausner Date: 11-Sep-97 Time: 14:30:14