Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jan 1999 16:17:36 -0800 (PST)
From:      asami@FreeBSD.ORG (Satoshi Asami)
To:        rnordier@nordier.com
Cc:        bde@zeta.org.au, freebsd-current@FreeBSD.ORG
Subject:   Re: How to Build & Run ELF Kernel
Message-ID:  <199901070017.QAA02235@silvia.hip.berkeley.edu>
In-Reply-To: <199901062357.BAA03690@ceia.nordier.com> (message from Robert Nordier on Thu, 7 Jan 1999 01:57:35 %2B0200 (SAT))

next in thread | previous in thread | raw e-mail | index | archive | help
Robert, thanks for your reply.

 * I'd check particularly whether the FreeBSD slice entry is 100%
 * correct.
 * 
 * The old bootblocks use the CHS value (257/1/1 below) to determine
 * the slice offset, whereas the new bootblocks use the start value
 * (4128768 below) and the disk geometry reported by the BIOS to derive
 * a CHS:
 * 
 *     [Sample fdisk output]
 *     sysid 165,(FreeBSD/NetBSD/386BSD)
 *         start 4128768, size 4305357 (2102 Meg), flag 80 (active)
 *             beg: cyl 257/ sector 1/ head 1;
 *             end: cyl 524/ sector 63/ head 254
 * 
 *     sector = 4128768 % 63 + 1    = 1
 *     head   = 4128768 / 63 % 255  = 1
 *     cyl    = 4128768 / 63 / 255  = 257

Hmm.  All my disks have a FreeBSD partition starting at sector 63
(start of second track of first cylinder).  Here's the one that
doesn't work:

===
## fdisk sd0
******* Working on device /dev/rsd0 *******
parameters extracted from in-core disklabel are:
cylinders=263 heads=255 sectors/track=63 (16065 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=263 heads=255 sectors/track=63 (16065 blks/cyl)
 :
The data for partition 2 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 63, size 4225032 (2063 Meg), flag 80 (active)
        beg: cyl 0/ sector 1/ head 1;
        end: cyl 262/ sector 63/ head 254
===

and the one that does work, on the same machine:

===
## fdisk sd1
******* Working on device /dev/rsd1 *******
parameters extracted from in-core disklabel are:
cylinders=274 heads=255 sectors/track=63 (16065 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=274 heads=255 sectors/track=63 (16065 blks/cyl)
 :
The data for partition 2 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 63, size 4401747 (2149 Meg), flag 80 (active)
        beg: cyl 0/ sector 1/ head 1;
        end: cyl 273/ sector 63/ head 254
===

As you can see, they are almost identical.  The only difference is the 
size of the disk/partitions.

As for other items on your checklist (reproduced here):

 *     o  Can't get the disk geometry from the BIOS

It did boot before with the old bootblocks, so it is getting the
geometry, right?

 *     o  The disk geometry would cause division by zero
 *     o  The derived cylinder number exceeds 1023

Both of these shouldn't apply to this case.

 *     o  BIOS fails to read a sector on five consecutive attempts

===
## dd if=/dev/rsd0 of=/dev/null bs=512 count=2048
2048+0 records in
2048+0 records out
1048576 bytes transferred in 1.827534 secs (573765 bytes/sec)
## tail /var/log/messages
 :
Jan  6 15:00:25 baloon sudo:    asami : TTY=ttyp0 ; PWD=/s/c/home/piedmont/asami ; USER=root ; COMMAND=/usr/local/bin/bash 
===

At least it seems quite readable from the FreeBSD kernel.  And again,
it was booting fine before I rewrote the bootblocks.

Satoshi

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



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