From owner-freebsd-ppc@FreeBSD.ORG Sun Mar 20 22:06:03 2011 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FDB7106566B for ; Sun, 20 Mar 2011 22:06:03 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id DF3AF8FC17 for ; Sun, 20 Mar 2011 22:06:02 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 4934658134 for ; Sun, 20 Mar 2011 17:06:02 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id LajRoj2N8x1f for ; Sun, 20 Mar 2011 17:06:02 -0500 (CDT) Received: from wanderer.tachypleus.net (unknown [76.210.65.155]) by mail.icecube.wisc.edu (Postfix) with ESMTP id D33A95811D for ; Sun, 20 Mar 2011 17:06:01 -0500 (CDT) Message-ID: <4D867A48.50408@freebsd.org> Date: Sun, 20 Mar 2011 17:06:00 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110317 Thunderbird/3.1.9 MIME-Version: 1.0 To: freebsd-ppc@freebsd.org References: <20110113220450.57d09983.torfinn.ingolfsen@broadpark.no> <20110114221406.34969090.torfinn.ingolfsen@broadpark.no> <4D31582F.1060300@FreeBSD.org> <20110115190637.7ac32abe.torfinn.ingolfsen@broadpark.no> <20110122200810.2386cbef.torfinn.ingolfsen@broadpark.no> <20110313221425.a8d3361f.torfinn.ingolfsen@broadpark.no> <4200D52B-ED04-4F6A-BA2A-EAD7DF3EBF37@gmail.com> <20110314212840.91564b62.torfinn.ingolfsen@broadpark.no> <20110318200242.f957f677.torfinn.ingolfsen@broadpark.no> <20110320230002.1d23e985.torfinn.ingolfsen@broadpark.no> In-Reply-To: <20110320230002.1d23e985.torfinn.ingolfsen@broadpark.no> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: PowerPC, gpart and multiboot (Was: Trying to install FreeBSD 8.2-RC1 on a PowerMac G5) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2011 22:06:03 -0000 On 03/20/11 17:00, Torfinn Ingolfsen wrote: > Anyway, here is my plan for multiboot: > root@kg-g5# gpart show ad0 > => 18 625142430 ad0 APM (298G) > 18 1600 1 apple-boot (800K) > 1618 155189248 2 freebsd-ufs (74G) > 155190866 8388608 3 freebsd-swap (4.0G) > 163579474 1600 4 apple-boot (800K) > 163581074 155189248 5 freebsd-ufs (74G) > 318770322 306372126 - free - (146G) > > The boot code in partition 4 (ad0s5) will be modified so that it boots from > the next partition (the partition after the one the bootcode itself is loaded from) > instead of the first partition. Do you think it's doable? > > I have examined boot1.c (in /usr/src/sys/boot/powerpc/boot1.chrp) but I don't > really understand how it is finding the partition to boot / load the kernel from. > > Can anyone explain it? I wrote it, so hopefully I can provide some insight. At line 423 of boot1.c, it loops through the first 16 (arbitrary) partitions on the device from which it was booted, then tries to find loader on the first UFS partition it can mount. This isn't actually a good algorithm, but it works pretty well. Making it choose the first following UFS partition might be a good idea, or do something useful with its arguments. -Nathan