Subject: port-i386/2054: port-i386 can only be told to boot off of first two disks
To: None <gnats-bugs@NetBSD.ORG>
From: Todd Kover <kovert@omniscient.com>
List: netbsd-bugs
Date: 02/09/1996 21:40:08
>Number:         2054
>Category:       port-i386
>Synopsis:       port-i386 can only be told to boot off of first two disks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb  9 22:35:07 1996
>Last-Modified:
>Originator:     Todd Kover
>Organization:
University of Maryland, UMIACS
>Release:        -current 2/7/96
>Environment:
System: NetBSD goofball.umiacs.umd.edu 1.1A NetBSD 1.1A (GOOFBALL) #12: Wed Feb 7 11:48:57 EST 1996 kovert@goofball.umiacs.umd.edu:/usr/src/sys/arch/i386/compile/GOOFBALL i386


>Description:

	At the boot prompt specifying anything besides drive 0 or
	drive 1 results in a 'Bad unit' number, despite the fact
	that there's a drive there..

	Basically, the code to check to see it'a  valid number
	checks to see if the drive number is between 0 and 9, then
	rejects it if it's not 0 or 1:

                if (*cp >= '0' && *cp <= '9')
                        if ((unit = *cp++ - '0') > 1) {
                                printf("Bad unit\n");
                                return 1; 


>How-To-Repeat:

	add 2 ide drives to a machine with scsi drives.  Try to boot off the
	scsi drive by-way-of:

		hd(2,a)/netbsd

	watch in confusion.
>Fix:
[goofball:26 boot] cvs diff sys.c
Index: sys.c
===================================================================
RCS file: /goofball/netbsd/master/src/sys/arch/i386/boot/sys.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 sys.c
192c192
<                       if ((unit = *cp++ - '0') > 1) {
---
>                       if ((unit = *cp++ - '0') > 9) {

>Audit-Trail:
>Unformatted: