Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Sep 1997 14:02:38 +0200 (MET DST)
From:      Alexander Hausner <alex@hugo.bmg.gv.at>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   fd.c and Compaq AERO
Message-ID:  <XFMail.970911143014.alex@hugo.bmg.gv.at>

next in thread | raw e-mail | index | archive | help
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 <seamus@rtfm.ocala.com>
>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 <sys/systm.h>
  #include <sys/kernel.h>
  #include <sys/conf.h>
! #include <sys/fcntl.h>
  #include <machine/clock.h>
  #include <machine/ioctl_fd.h>
  #include <sys/disklabel.h>
  #include <sys/buf.h>
  #include <sys/malloc.h>
  #include <sys/proc.h>
  #include <sys/syslog.h>
--- 61,73 ----
  #include <sys/systm.h>
  #include <sys/kernel.h>
  #include <sys/conf.h>
! #include <sys/file.h>
! #include <sys/ioctl.h>
  #include <machine/clock.h>
  #include <machine/ioctl_fd.h>
  #include <sys/disklabel.h>
  #include <sys/buf.h>
+ #include <sys/uio.h>
  #include <sys/malloc.h>
  #include <sys/proc.h>
  #include <sys/syslog.h>
***************
*** 84,89 ****
--- 88,99 ----
  #include <sys/devfsext.h>
  #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 <alex@hugo.bmg.gv.at>
Date: 11-Sep-97
Time: 14:30:14



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