*BSD News Article 35044


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!ihnp4.ucsd.edu!news.cerf.net!mvb.saic.com!MathWorks.Com!news.kei.com!hookup!swrinde!howland.reston.ans.net!agate!tfs.com!julian
From: julian@tfs.com (Julian Elischer)
Subject: Re: [FreeBSD] Booting frm sd0 as default?
Message-ID: <Cv2vs7.HIH@tfs.com>
Keywords: booting FreeBSD
Organization: TRW Financial Systems, Oakland, CA
References: <miff.777745860@apanix.apana.org.au> <vanepp.777775284@sfu.ca>
Date: Thu, 25 Aug 1994 06:38:31 GMT
Lines: 84

In article <vanepp.777775284@sfu.ca>,
Peter Van Epp <vanepp@fraser.sfu.ca> wrote:
>miff@apanix.apana.org.au (Michael Smith) writes:
>>I have 2 disks : one wd-style, with DOS alone.  One sd-style, with 
 
>>I've tried changing
 
>>	part = unit = 0;
>>	maj = (drive&0x80 ? 0 : 2);
 
>>in /sys/i386/boot/boot.c to 
 
>>	part = 0;
>>	unit = 1;
>>	maj = 1;

>
>	Try:
>
>	unit = drive & 0x7f;
>	part = 0;
>	maj = (drive&0x80 ? 0: 2);
>

the end result you want is to have from boot.c is:
maj=1 
part=0 
unit=1
as you suggest
so as to trigger the 'tricky bit' in sys.c

     case 1:
	dosdev = unit | 0x80;
	unit = 0;
     	break;

leaving you with:
dosdev == 0x81 (D:)
unit == 0	(sd or wd)0
maj = 1		

then in disk.c, the further transformation happens:
               if( (maj == 4) || (maj == 0) || (maj == 1))
                {
                        if (dl->d_type == DTYPE_SCSI)
                        {
                                maj = 4; /* use scsi as boot dev */
                        }
                        else
                        {
                                maj = 0; /* must be ESDI/IDE */
                        }
                }
which basically says:
for any kind of hard disk, select the major number
according to what the disklabel says it is..

so..

the end result is:

maj==4
part==0
unit==0
dosdev==1

theoretically, if you had two scsi,
wd1 would boot sd1 just fine..


I have no idea why the change made by Mike Smith did not work.
but he's definitly on the right track..

julian
(I wrote a lot of this horrid code (but several years ago)).

+----------------------------------+       ______ _  __
|   __--_|\  Julian Elischer       |       \     U \/ / On assignment
|  /       \ julian@tfs.com        +------>x   USA    \ in a very strange
| (   OZ    ) 300 lakeside Dr. oakland CA. \___   ___ | country !
+- X_.---._/  USA+(510) 645-3137(wk)           \_/   \\            
          v