From owner-freebsd-ppc@FreeBSD.ORG Tue Apr 10 17:00:20 2007 Return-Path: X-Original-To: freebsd-ppc@freebsd.org Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5ED2616A406 for ; Tue, 10 Apr 2007 17:00:20 +0000 (UTC) (envelope-from ph.schulz@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id C4C1013C459 for ; Tue, 10 Apr 2007 17:00:19 +0000 (UTC) (envelope-from ph.schulz@gmx.de) Received: (qmail invoked by alias); 10 Apr 2007 16:33:38 -0000 Received: from dslb-084-056-237-033.pools.arcor-ip.net (EHLO MacMini.local) [84.56.237.33] by mail.gmx.net (mp030) with SMTP; 10 Apr 2007 18:33:38 +0200 X-Authenticated: #1954550 X-Provags-ID: V01U2FsdGVkX1/SThowKVHSkmazNgbnR//CFYtLrfxuwCQuCYa2dv rf2m+OFLNz2aLt Message-ID: <461BBC5A.80005@gmx.de> Date: Tue, 10 Apr 2007 18:33:30 +0200 From: Philip Schulz User-Agent: Thunderbird 2.0.0.0 (Macintosh/20070326) MIME-Version: 1.0 To: vinay hegde References: <4084.50499.qm@web8407.mail.in.yahoo.com> In-Reply-To: <4084.50499.qm@web8407.mail.in.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 Cc: freebsd-ppc@freebsd.org Subject: Re: Help regarding the second stage loader 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: Tue, 10 Apr 2007 17:00:20 -0000 Hi, on 10.04.2007 16:59 Uhr vinay hegde said the following: > Can someone please let me know the place of the second > stage bootloader for FreeBSD PPC kernel under the > source trunk? I believe, it'll be something similar to > what linux does (under arch/ppc/boot/simple, > arch/ppc/boot/common and arch/ppc/kernel directories). I don't know how Linux "officially" boots on PowerPC, however I load yaboot which in turn loads the kernel. I don't think yaboot is maintained with the kernel but rather as a separate project. > I browsed thru' the FreeBSD boot directories > (sys/boot/powerpc/loader directory), but couldn't find > any second stage loader code. > FreeBSD's loader code is spread under sys/boot. Relevant parts are not only sys/boot/powerpc/loader, but also the Forth-interpreter in sys/boot/ficl. Additionally, the files in sys/boot/ofw contain code to talk to Open Firmware, used for example to load the kernel, e.g. from disk or network. The sys/boot/common directory seems to contain the parts relevant for all platforms like the ELF loader. The way FreeBSD/powerpc boots is slightly different from how FreeBSD boots on a PC. You can load and start the kernel directly from Open Firmware since it's an ELF file. However, that only works if the kernel resides on a filesystem the Open Firmware implementation understands and if you don't need to set any boot flags. Unfortunately, the implementation found on Apples computers does not know UFS(2). So a different approach (and I think that one is recommended) is to start the loader which will be able load the kernel, also from the / filesystem, and set boot flags (verbose boot, boot to single user, etc.). So in short: There is no second stage bootloader, only the loader and the kernel. Someone please correct me if I'm wrong. HTH, Phil. -- Don't fix it if it ain't broke.