From owner-freebsd-questions@FreeBSD.ORG Sun Oct 15 08:33:14 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DF5916A403 for ; Sun, 15 Oct 2006 08:33:14 +0000 (UTC) (envelope-from netch@lucky.net) Received: from burka.carrier.kiev.ua (burka.carrier.kiev.ua [193.193.193.107]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0335943D67 for ; Sun, 15 Oct 2006 08:33:12 +0000 (GMT) (envelope-from netch@lucky.net) Received: from burka.carrier.kiev.ua (netch@localhost [127.0.0.1]) by burka.carrier.kiev.ua with ESMTP id k9F8X6nV010814; Sun, 15 Oct 2006 11:33:09 +0300 (EEST) (envelope-from netch@burka.carrier.kiev.ua) Received: (from netch@localhost) by burka.carrier.kiev.ua (8.13.1/8.13.1/Submit) id k9F8X6JR010811; Sun, 15 Oct 2006 11:33:06 +0300 (EEST) (envelope-from netch) Date: Sun, 15 Oct 2006 11:33:06 +0300 From: Valentin Nechayev To: Jerry McAllister Message-ID: <20061015083306.GA7624@lucky.net> References: <20061014164101.8507.qmail@web52113.mail.yahoo.com> <20061014183053.GA6898@lucky.net> <20061015011555.GB25929@gizmo.acns.msu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20061015011555.GB25929@gizmo.acns.msu.edu> X-42: On X-Verify-Sender: Address has been verified (burka.carrier.kiev.ua) X-Antivirus: Dr.Web (R) for Mail Servers on ghost.carrier.kiev.ua host X-Antivirus-Code: 100000 X-Content-Filter: burka.carrier.kiev.ua: passed Cc: Jan Pfeifer , freebsd-questions@freebsd.org Subject: Re: Boot2 loading process X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: netch@lucky.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2006 08:33:14 -0000 Sat, Oct 14, 2006 at 21:15:55, jerrymc wrote about "Re: Boot2 loading proc= ess":=20 > >> So my question is: where does the rest of the boot2 binary is located = and how is it loaded ? >> You skipped boot1 from attention. boot2 is loaded by boot1, not boot0. > Not according to that piece of architecture documentation that was quoted. > www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/book.html#BOOT-B= OOT0 > It says that boot1 is used only with floppy boots. The doc is incorrect, or at least uses less detailed description. One can see from code that boot0 loads _one_ sector from slice and calls its code. Initial block of the bootable slice is identical to /boot/boot1: $ dd if=3D/dev/ad0s1a bs=3D512 count=3D1 | head -c 446 | md5 -r 42b4daabbfea8c8d3ec45e24b340868a $ head -c 446 /boot/boot1 | md5 -r 42b4daabbfea8c8d3ec45e24b340868a And reading code in /usr/src/sys/boot/i386/boot2/boot1.S is enough to see that it is the routine which loads 8K including boot2. Maybe documentation clause (that boot0 loads boot2 directly) remains =66rom other version of boot0, or is used to simplify the description (because boot1 is silent part and shows something only in case of fatal error). But it's anyway too simplified as to reply to original question in this thread. This difference (boot0 loads boot2 directly or thru boot1) was vital when 4.x and 5.x resides on the same disk. This was case for my home machine a few years ago. Boot1 shall be the same version as boot2. Changes in their interaction caused problem to load FreeBSD from second slice (it was 5.x), that's why I had to use special boot setup. -netch-