Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 1995 23:40:37 +0100
From:      Mark Valentine <mark@linus.demon.co.uk>
To:        current@FreeBSD.org
Subject:   problem with new biosboot?
Message-ID:  <199505102240.XAA00336@linus.demon.co.uk>

index | next in thread | raw e-mail

> phk         95/05/07 19:03:03
> 
>   Modified:    sys/i386/boot/biosboot  disk.c
>   Log:
>   Make disk.c smart enough to handle disk with "OnTrack Disk manager".
>   Make it complain if people try to boot from a partition which extends
>   past 1024 cylinders.  This is better than a random reset...

Since these boot blocks now tell me that my "partition is out of reach from
the bios", I guess I'd better try to understand what might be wrong with my
slice/partition configuration.  However, I can't follow the code...

                /* 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 / spt > 1024) {
                        printf("partition is out of reach from the bios\n");
                        return 1;
                }

Why is dl->d_partitions[2].p_offset meaningful even if I don't have OnTrack
DiskManager?  Why can't my partition be >1024 cylinders?

The disk in question is a 1GB SCSI (Quantum PD1050iS), attached to an AHA1542C.

  # fdisk /dev/sd0
  ******* Working on device /dev/sd0 *******
  parameters extracted from in-core disklabel are:
  cylinders=2448 heads=12 sectors/track=69 (828 blks/cyl)
  
   Figures below won't work with BIOS for partitions not in cyl 1
  parameters to be used for BIOS calculations are:
  cylinders=2448 heads=12 sectors/track=69 (828 blks/cyl)
  
  Warning: BIOS sector numbering starts with sector 1
  Information from DOS bootblock is:
  The data for partition 0 is:
  <UNUSED>
  The data for partition 1 is:
  <UNUSED>
  The data for partition 2 is:
  <UNUSED>
  The data for partition 3 is:
  sysid 165,(FreeBSD/NetBSD/386BSD)
      start 0, size 50000 (24 Meg), flag 80
          beg: cyl 0/ sector 1/ head 0;
          end: cyl 1023/ sector 63/ head 255

The geometry is the untranslated version.  The bogus slice isn't what I
remember setting it up as when I upgraded to FreeBSD 2.0 (950210 SNAP),
but probably happened when I used disklabel -e to specify non-zero RPM,
etc. (?)  I used what I thought was a correct sizing based on the
translated geometry at that time.

Curiously, the compatibility device shows me an MBR table with the translated
geometry:

  # fdisk /dev/sd0d
  ******* Working on device /dev/sd0d *******
  parameters extracted from in-core disklabel are:
  cylinders=1003 heads=64 sectors/track=32 (2048 blks/cyl)
  
  parameters to be used for BIOS calculations are:
  cylinders=1003 heads=64 sectors/track=32 (2048 blks/cyl)
  
  Warning: BIOS sector numbering starts with sector 1
  Information from DOS bootblock is:
  The data for partition 0 is:
  <UNUSED>
  The data for partition 1 is:
  <UNUSED>
  The data for partition 2 is:
  <UNUSED>
  The data for partition 3 is:
  sysid 165,(FreeBSD/NetBSD/386BSD)
      start 0, size 50000 (24 Meg), flag 80
          beg: cyl 0/ sector 1/ head 0;
          end: cyl 1023/ sector 63/ head 255

Which of these is relevant, and where on the disk is the other one stored?!

My disklabel uses translated geometry:

  # disklabel -r sd0
  # /dev/rsd0c:
  type: SCSI
  disk: 
  label: MBR based label
  flags:
  bytes/sector: 512
  sectors/track: 32
  tracks/cylinder: 64
  sectors/cylinder: 2048
  cylinders: 1003
  sectors/unit: 2055096
  rpm: 3600
  interleave: 1
  trackskew: 0
  cylinderskew: 0
  headswitch: 0           # milliseconds
  track-to-track seek: 0  # milliseconds
  drivedata: 0 
  
  8 partitions:
  #        size   offset    fstype   [fsize bsize bps/cpg]
    a:    36864        0    4.2BSD     1024  8192    16   # (Cyl.    0 - 17)
    b:    81920    36864      swap                        # (Cyl.   18 - 57)
    c:  2055096        0    unused        0     0         # (Cyl.    0 - 1003*)
    d:  2055096        0    unused        0     0         # (Cyl.    0 - 1003*)
    e:   102400   118784    4.2BSD     1024  8192    16   # (Cyl.   58 - 107)
    f:   512000   221184    4.2BSD     1024  8192    16   # (Cyl.  108 - 357)
    g:  1024000   733184    4.2BSD     1024  8192    16   # (Cyl.  358 - 857)
    h:   296960  1757184    4.2BSD     1024  8192    16   # (Cyl.  858 - 1002)

I thought maybe partition 'a' shouldn't be at offset 0, but a fresh
trial installation on wd0 (again of 950210-SNAP, using the whole disk
for FreeBSD) also had this (no manual tweaking on that one).

I thought I was beginning to understand all this, and I'd been running
without problems for a few months (last disklabel -B sd0 was just after
the last change to biosboot before this one).  Any pointers as to what
I'm not taking in?

		Cheers,

		Mark.


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199505102240.XAA00336>