From owner-freebsd-ppc@FreeBSD.ORG Tue Oct 14 19:23:38 2003 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B31C716A4B3 for ; Tue, 14 Oct 2003 19:23:38 -0700 (PDT) Received: from dommail.onthenet.com.au (dommail.OntheNet.com.au [203.13.70.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8ED2C43F3F for ; Tue, 14 Oct 2003 19:23:34 -0700 (PDT) (envelope-from grehan@freebsd.org) Received: from freebsd.org (CPE-203-45-244-178.qld.bigpond.net.au [203.45.244.178]) by dommail.onthenet.com.au (Mirapoint Messaging Server MOS 3.2.4-GA) with ESMTP id ABT99870 (AUTH peterg@ptree32.com.au); Wed, 15 Oct 2003 12:23:28 +1000 (EST) Sender: grehan@dommail.onthenet.com.au Message-ID: <3F8CAFAE.6260CFCF@freebsd.org> Date: Wed, 15 Oct 2003 12:23:42 +1000 From: Peter Grehan X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.2.14-12 i686) X-Accept-Language: en MIME-Version: 1.0 To: Jaworowski Rafal-ARJ004 References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-ppc@freebsd.org Subject: Re: FYI: rudimentary loader for ppcbug-based systems X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Oct 2003 02:23:38 -0000 Hi Rafal, > What do you think is the right way of adding support in the kernel for another firmware > but within the same architecture (powerpc in this case)? Should we just have a number of > #ifdefs where appropriate, or maybe we should think about separating some bits and defining > clean interfaces to common parts? Eventually I intend to let my work be merged with existing > powerpc code in the tree and that's why I'd like to know what course to take. For now I'll > just be using conditional compilation flags. Clean interfaces would be the best. The ultimate is a single kernel that could run on all combinations of processor and firmware, the true GENERIC, but I'm not sure if that's possible. Here's a quick summary of the OFW dependencies in powerpc/powerpc/* - locore.S - the entry point assumes the OFW calling convention clock.c - the time-of-day and CPU's timebase frequency are obtained from OFW machdep.c - the shutdown/halt routines call into OFW. nexus.c - heavily OFW dependent. Any other platform will require their own version of this. openpic.c - The OFW code could be split out of this to allow the OpenPIC code to be used on other platforms pmap.c - Not as bad as it looks. The setting up of the BAT array is specific to the h/w layout of Macs. OFW is used to determine the memory layout, and the PTE entries for OFW are not required on non-OFW systems. later, Peter.