From owner-freebsd-current Thu May 18 06:02:28 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id GAA07490 for current-outgoing; Thu, 18 May 1995 06:02:28 -0700 Received: from inet-gw-1.pa.dec.com (inet-gw-1.pa.dec.com [16.1.0.22]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id GAA07483 for ; Thu, 18 May 1995 06:02:26 -0700 Received: from rks32.pcs.dec.com by inet-gw-1.pa.dec.com (5.65/24Feb95) id AA19603; Thu, 18 May 95 05:58:33 -0700 Received: by rks32.pcs.dec.com (Smail3.1.27.1 #16) id m0sC55a-0005PIC; Thu, 18 May 95 14:54 MSZ Message-Id: To: current%freebsd.org@inet-gw-1.pa.dec.com Subject: bios boot bug ? Reply-To: gj@FreeBSD.org Date: Thu, 18 May 95 12:54:06 GMT From: "gj%pcs.dec.com@inet-gw-1.pa.dec.com" Sender: current-owner@FreeBSD.org Precedence: bulk I tried to boot a newly installed system last night using the new bios boot code (generated on May 13). No matter what values I used in fdisk I always got "partition is out of reach from the bios" Looking at the code, the following fragment from disk.c appears bogus: /* This little trick is for OnTrack DiskManager disks */ boff = dl->d_partitions[part].p_offset - dl->d_partitions[2].p_offset + sector; /* This is a good idea for all disks */ bsize = dl->d_partitions[part].p_size; bend = boff + bsize - 1 ; if (bend / spc > 1024) { printf("partition is out of reach from the bios\n"); return 1; } spc is sectors per cylinder. The problem is that the values in the disklabel are byte values, not sector values. Or has this changed without me noticing ? When I commented out this fragment, I was at least able to load /kernel (then I ran into problems with the f*cking disk slice code...grrr). Seems like this should read /* This little trick is for OnTrack DiskManager disks */ boff = (dl->d_partitions[part].p_offset - dl->d_partitions[2].p_offset) >> 9 + sector; /* This is a good idea for all disks */ bsize = dl->d_partitions[part].p_size; bend = boff + (bsize >> 9) - 1 ; if (bend / spc > 1024) { printf("partition is out of reach from the bios\n"); return 1; } to convert to sectors. Note that I haven't tried out this change, I'm at work. Am I totally fubar here ? Gary J.