*BSD News Article 69653


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!news.sdsmt.edu!nntp.uac.net!news.tufts.edu!blanket.mitre.org!news.mathworks.com!newsfeed.internetmci.com!news.msfc.nasa.gov!pendragon!ames!cnn.nas.nasa.gov!win126.nas.nasa.gov!newhouse
From: newhouse@win126.nas.nasa.gov (Paul Newhouse)
Newsgroups: comp.unix.bsd.netbsd.misc
Subject: Odd code in boot/sys.c
Date: 29 May 1996 01:24:14 GMT
Organization: NAS
Lines: 30
Message-ID: <4og8vu$at5@cnn.nas.nasa.gov>
NNTP-Posting-Host: win126.nas.nasa.gov

I found the following code in boot/sys.c (-current).  Which goes a long way in explaining
why I can't boot from my third IDE disk (Secondary Master):

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

I'm at a loss as to why the code checks for the character pointed at by cp to
be within the range 0-9, inclusive, and then after decoding it decides to limit
the range to 0 or 1??  

You don't get "Bad unit", if you specify 'x' instead of 0-9.

Is there a problem with using 2 or 3 in the boot line:  "wd(2,a)/netbsd"
I was pretty sure I had this working on a previous version of NetBSD (maybe it was
FreeBSD or BSDI???).

I thought I'd ask before changing the "> 1" to "> 9".  Just incase there is some
really bad thing that can happen.  Suggestions, comments, actual knowledge
are appreciated.

Thanks,
Paul
-- 
----------------------------------------------------------------------
All views, opinions and statements are my own.  They are not necessarily 
those of any employer, client or associate. If you want their opinion
you should ask them  *8^)