From nobu@kafka.psrc.isac.co.jp  Tue Oct 10 00:19:00 1995
Received: from kafka.psrc.isac.co.jp ([192.47.120.112])
          by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id AAA18497
          for <FreeBSD-gnats-submit@freebsd.org>; Tue, 10 Oct 1995 00:18:57 -0700
Received: (from nobu@localhost) by kafka.psrc.isac.co.jp (8.6.12/8.6.12) id BAA00757; Wed, 11 Oct 1995 01:16:27 +0900
Message-Id: <199510101616.BAA00757@kafka.psrc.isac.co.jp>
Date: Wed, 11 Oct 1995 01:16:27 +0900
From: nobu@psrc.isac.co.jp
Reply-To: nobu@psrc.isac.co.jp
To: FreeBSD-gnats-submit@freebsd.org
Subject: panic with changing root device
X-Send-Pr-Version: 3.2

>Number:         775
>Category:       kern
>Synopsis:       changing root device was wrong when exist IDE drive
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bde
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 10 00:20:01 PDT 1995
>Closed-Date:    Wed Feb 7 05:51:36 PST 1996
>Last-Modified:  Wed Feb  7 06:09:24 PST 1996
>Originator:     Nobuhiro Yasutomi
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
ISAC, Inc. JAPAN
>Environment:

	1 IDE hard disk dirve, 3 SCSI hard disk drives.
	SCSI CD-ROM drive, 3.5'FD drive, 486DX2/66, 32Mbytes RAM
	AHA-1542CF.

>Description:

	wd0 enable on BIOS and FreeBSD installed on sd0,
	this case root device chose ``sd1a'' then make panic 
	when start init (not found init program).

>How-To-Repeat:

	active 1st IDE and FreeBSD boot on SCSI drive

>Fix:
	
	I am changing /sys/i386/i386/autoconf.c to escape this problem.
	Any hints following?

--- autoconf.c.orig	Wed Oct 11 01:05:28 1995
+++ autoconf.c	Tue Oct 10 23:05:56 1995
@@ -275,7 +275,12 @@
 	if (majdev > sizeof(devname) / sizeof(devname[0]))
 		return;
 	adaptor = (bootdev >> B_ADAPTORSHIFT) & B_ADAPTORMASK;
+#if 1
+	/* XXX: need discount wd drive numbers */
+	unit = (bootdev >> B_UNITSHIFT) & B_UNITMASK - 1;
+#else
 	unit = (bootdev >> B_UNITSHIFT) & B_UNITMASK;
+#endif
 	if (majdev == FDMAJOR) {
 		part = RAW_PART;
 		mindev = unit << FDUNITSHIFT;

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->bde 
Responsible-Changed-By: pst 
Responsible-Changed-When: Tue Feb 6 22:25:11 PST 1996 
Responsible-Changed-Why:  
State-Changed-From-To: open->closed 
State-Changed-By: bde 
State-Changed-When: Wed Feb 7 05:51:36 PST 1996 
State-Changed-Why:  
Automatic booting from sd0 when wd0 is installed is not supported. 
The boot prompt gives the non-automatic method: 
"Use hd(1,a)/kernel to boot sd0 when wd0 is also installed." 
>Unformatted:
