From owner-freebsd-bugs Sat Feb 10 21: 0:21 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 60E5437B491 for ; Sat, 10 Feb 2001 21:00:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f1B502330621; Sat, 10 Feb 2001 21:00:02 -0800 (PST) (envelope-from gnats) Received: from rcpt-expgw.biglobe.ne.jp (rcpt-expgw.biglobe.ne.jp [210.147.6.214]) by hub.freebsd.org (Postfix) with ESMTP id F261937B401 for ; Sat, 10 Feb 2001 20:52:00 -0800 (PST) Received: from smtp-gw.biglobe.ne.jp by rcpt-expgw.biglobe.ne.jp (8.9.3+3.2W/3.7W-01020916) with ESMTP id NAA18034 for ; Sun, 11 Feb 2001 13:51:59 +0900 (JST) Received: from ngy115DS61.aic.mesh.ad.jp (133.205.105.107 [133.205.105.107]) by smtp-gw.biglobe.ne.jp id NAMNC0A826A2; Sun, 11 Feb 2001 13:51:58 +0900 (JST) Received: (qmail 5886 invoked from network); 11 Feb 2001 04:47:07 -0000 Received: from localhost (127.0.0.1) by localhost with SMTP; 11 Feb 2001 04:47:07 -0000 Message-Id: <20010211.134707.59464862.thasegawa@mta.biglobe.ne.jp> Date: Sun, 11 Feb 2001 13:47:07 +0900 (JST) From: HASEGAWA Tomoki Reply-To: thasegawa@mta.biglobe.ne.jp To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: i386/24997: /boot/loader cannot handle extended dos partitions Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 24997 >Category: i386 >Synopsis: /boot/loader cannot handle extended dos partitions >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Feb 10 21:00:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: HASEGAWA Tomoki >Release: FreeBSD 4.2-STABLE i386 >Organization: >Environment: FreeBSD 4.2-STABLE(2001/02/10) i386 FreeBSD 5.0-CURRENT(2001/02/10) i386 >Description: /boot/loader cannot handle extended dos partitions in ide disks (except slice 5(eg disk0s5)). I cannot boot with root partition /dev/ad0s9a. devices in FreeBSD corresponding disk name in /boot/loader /dev/ad0s5 -> disk0s5 /dev/ad0s6 -> disk0s7 /dev/ad0s7 or higher -> cannot handle >How-To-Repeat: make extended dos partitions and use 'lsdev' command in the /boot/loader command line. >Fix: I referred to sys/kern/subr_diskmbr.c and revised sys/boot/i386/libi386/biosdisk.c. The patch is following. Index: biosdisk.c =================================================================== RCS file: /home/ncvs/src/sys/boot/i386/libi386/biosdisk.c,v retrieving revision 1.26.2.6 diff -u -r1.26.2.6 biosdisk.c --- biosdisk.c 2000/12/28 13:10:47 1.26.2.6 +++ biosdisk.c 2001/02/10 05:59:00 @@ -132,7 +132,7 @@ static int bd_opendisk(struct open_disk **odp, struct i386_devdesc *dev); static void bd_closedisk(struct open_disk *od); static int bd_bestslice(struct open_disk *od); -static void bd_checkextended(struct open_disk *od, int slicenum); +static void bd_checkextended(struct open_disk *od, int slicenum, int basenum); /* * Translate between BIOS device numbers and our private unit numbers. @@ -512,7 +512,7 @@ sizeof(struct dos_partition) * NDOSPART); od->od_nslices = 4; /* extended slices start here */ for (i = 0; i < NDOSPART; i++) - bd_checkextended(od, i); + bd_checkextended(od, i, i); od->od_flags |= BD_PARTTABOK; dptr = &od->od_slicetab[0]; @@ -624,12 +624,12 @@ } static void -bd_checkextended(struct open_disk *od, int slicenum) +bd_checkextended(struct open_disk *od, int slicenum, int basenum) { char buf[BIOSDISK_SECSIZE]; struct dos_partition *dp; u_int base; - int i, start, end; + int i, start; dp = &od->od_slicetab[slicenum]; start = od->od_nslices; @@ -651,17 +651,21 @@ continue; if (od->od_nslices == MAX_SLICES) goto done; - dp->dp_start += base; - bcopy(dp, &od->od_slicetab[od->od_nslices], sizeof(*dp)); - od->od_nslices++; + if (dp->dp_typ == DOSPTYP_EXT) { + dp->dp_start += od->od_slicetab[basenum].dp_start;; + bcopy(dp, &od->od_slicetab[od->od_nslices], sizeof(*dp)); + } else { + dp->dp_start += base; + bcopy(dp, &od->od_slicetab[od->od_nslices], sizeof(*dp)); + od->od_nslices++; + } } - end = od->od_nslices; /* * now, recursively check the slices we just added */ - for (i = start; i < end; i++) - bd_checkextended(od, i); + for (i = start; i < start + NDOSPART; i++) + bd_checkextended(od, i, basenum); done: return; } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message