NetBSD Problem Report #460
From gnats Mon Sep 5 13:12:18 1994
Received: from python.CS.ORST.EDU (root@python.CS.ORST.EDU [128.193.164.60]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id NAA01552 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Mon, 5 Sep 1994 13:12:16 -0700
Message-Id: <199409051914.MAA22727@santiam.CS.ORST.EDU>
Date: Mon, 5 Sep 1994 12:14:10 -0700
From: "Jason R. Thorpe" <thorpej@mail.CS.ORST.EDU>
Reply-To: thorpej@mail.CS.ORST.EDU
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: scsi slaves treated as unit's
X-Send-Pr-Version: 3.2
>Number: 460
>Category: port-hp300
>Synopsis: scsi slaves treated as unit's
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: gnats-admin (GNATS administrator)
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Sep 05 13:20:19 +0000 1994
>Closed-Date: Mon Sep 19 00:27:46 +0000 1994
>Last-Modified:
>Originator: Jason R. Thorpe
>Release: NetBSD 1.0_BETA (sup'd 9/4/94)
>Organization:
Department of Computer Science
Oregon State University
>Environment:
System: NetBSD santiam 1.0_BETA NetBSD 1.0_BETA (SANTIAM) #0: Thu Aug 11 13:42:08 PDT 1994 thorpej@santiam:/tmp_mnt/hurricane/NetBSD/src/sys/arch/hp300/compile/SANTIAM hp300
>Description:
When attempting to place root and swap on a device other than
slave 0, autoconf.c generates a warning:
WARNING: using device at unit 0 of controller
This is due to scsi being fundamentally different
from hpib. hpib drives have 1 controller per disk, whereas
many drives hang off of a scsi controller. These drives
hanging off of the controller are being incorrectly treated
as units, similar to the hp7946 (which has a disk at unit 0
and a tape at unit 1). The code always assumes unit 0, which
in the case of scsi, is not necessarily correct.
>How-To-Repeat:
bits from my kernel config:
config netbsd root on sd0 swap on sd0b
master scsi0 at scode?
master scsi1 at scode?
master scsi2 at scode?
master scsi3 at scode?
disk sd0 at scsi0 slave 5
disk sd1 at scsi0 slave 6
disk sd2 at scsi0 slave 2
disk sd3 at scsi0 slave 3
disk sd4 at scsi0 slave 4
disk sd5 at scsi0 slave 5
disk sd6 at scsi0 slave 6
disk sd7 at scsi1 slave 0
disk sd8 at scsi1 slave 1
disk sd9 at scsi1 slave 2
disk sd10 at scsi0 slave 0
tape st0 at scsi? slave ?
tape st1 at scsi? slave ?
Note that scsi0, slave 0 is a cdrom drive...
Upon booting a kernel configured in this manner, after the autoconf
sequence, the warning message is generated and the kernel reports:
changing root device to sd10a
...and then panics with a zero-divide trap, because the drive is
empty. This behavior is not exihibited if booting off of an hpib
disk, no matter which slave, since the disk is always at unit 0 (at
least it is on all of my hpib disks...)
Note - just umplugging the cdrom won't do it, since sd0 is still at
slave (and therefore unit) 5 of scsi0
>Fix:
Well, I can describe how I'd do it...
Determine whether or not the root/swap is being done
on a scsi disk. If so, then set the unit # check to
the slave id, and also use that number whenever unit 0
is assumed. If the disk is not scsi, then perhaps just
default to unit 0, as the code does now. Essentially, the following
(at line 1024 of autoconf.c) is incorrect:
if (unit != 0)
printf("WARNING: using device at unit 0 of controller\n");
mindev = hd->hp_unit;
Actual code is unknown to me at the moment...But after enough
coffee, I'm sure I can come up with something...
This was caused by some misguided changes that were made relative to
the 4.4-Lite code. I've fixed this and a few other bugs. - mycroft
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: mycroft
State-Changed-When: Sun Sep 18 17:27:46 PDT 1994
State-Changed-Why:
Fixed.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.