From owner-freebsd-current Wed Jan 6 16:18:39 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA28868 for freebsd-current-outgoing; Wed, 6 Jan 1999 16:18:39 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from vader.cs.berkeley.edu (vader.CS.Berkeley.EDU [128.32.38.234]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA28863 for ; Wed, 6 Jan 1999 16:18:39 -0800 (PST) (envelope-from asami@vader.cs.berkeley.edu) Received: from silvia.hip.berkeley.edu (sji-ca7-163.ix.netcom.com [209.109.235.163]) by vader.cs.berkeley.edu (8.8.7/8.7.3) with ESMTP id QAA10084; Wed, 6 Jan 1999 16:17:58 -0800 (PST) Received: (from asami@localhost) by silvia.hip.berkeley.edu (8.9.1/8.6.9) id QAA02235; Wed, 6 Jan 1999 16:17:36 -0800 (PST) Date: Wed, 6 Jan 1999 16:17:36 -0800 (PST) Message-Id: <199901070017.QAA02235@silvia.hip.berkeley.edu> To: rnordier@nordier.com CC: bde@zeta.org.au, freebsd-current@FreeBSD.ORG In-reply-to: <199901062357.BAA03690@ceia.nordier.com> (message from Robert Nordier on Thu, 7 Jan 1999 01:57:35 +0200 (SAT)) Subject: Re: How to Build & Run ELF Kernel From: asami@FreeBSD.ORG (Satoshi Asami) Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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