From owner-freebsd-hackers@FreeBSD.ORG Tue May 31 15:01:28 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0A85106566C for ; Tue, 31 May 2011 15:01:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A8E628FC0A for ; Tue, 31 May 2011 15:01:28 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5C0B246B37; Tue, 31 May 2011 11:01:28 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 501C58A02A; Tue, 31 May 2011 11:01:27 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Tue, 31 May 2011 10:33:46 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <20110530174243.95200@gmx.com> In-Reply-To: <20110530174243.95200@gmx.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201105311033.47021.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 31 May 2011 11:01:28 -0400 (EDT) Cc: Dieter BSD Subject: Re: Active slice, only for a next boot X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2011 15:01:28 -0000 On Monday, May 30, 2011 1:42:39 pm Dieter BSD wrote: > And it works great. Except that one of the 27 stages of boot > code that FreeBSD uses INSISTS on booting the active slice, > so you can tell the MBR to boot slice 3 and slice 3's boot > code sees that slice 4 is active and boots slice 4. There are only 3 stages, and boot1.S is what looks at the active slice. Unfortunately it doesn't have a better way to do this as the only input it gets from boot0 or any other MBR boot loader is the BIOS drive number in %dl. I'm not sure how else you would detect that a non-active slice was booted from when that is your only input. One could define some extended structure to pass that information and send it in a register, but you'd still have to cope with MBR boot loaders that don't pass it (e.g. the Windows ones if you are dual-booting with Windows) and you'd need to have some sanity checks to make sure one doesn't treat garbage input as valid. -- John Baldwin