Subject: port-i386/3418: i386 boot fails with 2.88 Mb diskette drive
To: None <gnats-bugs@gnats.netbsd.org>
From: None <moore@cs.utk.edu>
List: netbsd-bugs
Date: 03/31/1997 02:08:31
>Number:         3418
>Category:       port-i386
>Synopsis:       i386 boot fails with 2.88 Mb diskette drive
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 30 23:20:01 1997
>Last-Modified:
>Originator:     Keith Moore
>Organization:
none
>Release:        1.2
>Environment:
	Thinkpad 750 laptop, NetBSD 1.2 
System: NetBSD spot 1.2D NetBSD 1.2D (GENERIC) #0: Thu Mar 20 19:58:00 EST 1997 moore@spot:/a/ig/wayward/homes/moore/netbsd-current/usr/src/sys/arch/i386/compile/GENERIC i386


>Description:
	If you try to boot the 1.2 install floppy (on a 1.44 Mb disk)
	from a 2.88 Mb drive, the boot will fail.  The bios reports 
	36 sectors/track, but the disk only has 18 sectors/track.
>How-To-Repeat:
	1. copy the 1.2 kernel copy image onto a 1.44 Mb disk.
	2. try to boot it from a 2.88 Mb drive. 
>Fix:
	I considered trying to read the disk label, but this would
	make it difficult to use the same install floppy image with 
	multiple diskette types.  So I hacked an auto-detect for
	a 1.44 Mb disk in a 2.88 Mb drive.  This seems to work.

*** arch/i386/boot/disk.c.ORIG  Sun Mar 12 07:09:18 1995
--- arch/i386/boot/disk.c       Mon Mar 31 01:45:02 1997
***************
*** 66,71 ****
--- 66,78 ----
  
        di = get_diskinfo(dosdev);
        spc = (spt = SPT(di)) * HEADS(di);
+ #if 1
+       if (spt == 36 && biosread (dosdev, 0, 0, 18, 1, iobuf)) {
+               printf ("[assuming 1.44 Mb diskette in 2.88 Mb drive]\n");
+               spt = 18;
+               spc = spt * HEADS(di);
+       }
+ #endif
        if (dosdev == 2) {
                boff = 0;
                part = (spt == 15 ? 3 : 1);

>Audit-Trail:
>Unformatted: