Subject: Re: Booting without ofwboot
To: Chuck Silvers <chuq@chuq.com>
From: Jorge Acereda <jacereda@gmail.com>
List: port-ofppc
Date: 10/24/2004 22:02:30
On Sat, 23 Oct 2004 11:34:22 -0700, Chuck Silvers <chuq@chuq.com> wrote:
> On Sat, Oct 23, 2004 at 06:18:56PM +0200, Jorge Acereda wrote:

> as I recall, the FirePower box loaded ofwboot and the kernel, but then
> the kernel didn't print anything... similar to what you saw on your box.

Hi,

I spent some time trying to figure out what the problem was, I can now
reach the point where the kernel asks for a boot partition. It seems
there's an issue with openfirmware(). My PPC skills are weak, so I
would appreciate any help in tracking the problem.

Here is the dirty patch, it is just what openfirmware() looked like
for ofppc in 1.6 days:

diff -u -r1.2 ofw_subr.S
--- sys/arch/powerpc/oea/ofw_subr.S	13 Feb 2003 15:02:49 -0000	1.2
+++ sys/arch/powerpc/oea/ofw_subr.S	24 Oct 2004 19:42:38 -0000
@@ -92,6 +92,33 @@
  */
 	.text
 ENTRY(openfirmware)
+#if 1 /* XXX */
+	mflr	0			/* save return address */
+	stw	0,4(1)
+	stwu	1,-16(1)		/* setup stack frame */
+
+	mfmsr	4			/* save msr */
+	stw	4,8(1)
+
+	lis	4,openfirmware_entry@ha	/* get firmware entry point */
+	lwz	4,openfirmware_entry@l(4)
+	mtlr	4
+
+	li	0,0			/* turn off any ints/mmu/etc. */
+	mtmsr	0
+	isync
+
+	blrl				/* call OpenFirmware */
+
+	lwz	4,8(1)			/* restore msr */
+	mtmsr	4
+	isync
+
+	lwz	1,0(1)			/* and return */
+	lwz	0,4(1)
+	mtlr	0
+	blr
+#endif		
 	mflr	0			/* save return address */
 	stw	0,4(1)
 	stwu	1,-16(1)		/* setup stack frame */