Subject: Re: Bull (Motorola) Escala T604e
To: Jochen Kunz <jkunz@unixag-kl.fh-kl.de>
From: Allen Briggs <briggs@wasabisystems.com>
List: port-powerpc
Date: 10/24/2002 21:58:43
On Fri, Oct 25, 2002 at 12:59:17AM +0200, Jochen Kunz wrote:
> > you can probably just use normal printf() debugging
> > to narrow down where it crashes.
> Sure, in this case. But if the kernel freezes somwhere deep in locore.S
> or machdep.c on the way finding its console device, printf is no help.
> 
> Anyway, I threw lots of printf at ofwboot. It gets interresting in
> sys/lib/libsa/open.c at         for (i = 0; i < nfsys; i++) {
> printf( "open D i=%d, nfsys=%d file='%s'\n", i , nfsys, file);
>                 error = FS_OPEN(&file_system[i])(file, f);
> printf( "open e, nfsys=%d, error=%d\n", nfsys, error);
> 
> At the first printf nfsys is ==1, at the second printf nfsys is ==[some
> random value].

Looks like a smashed stack, alright.  Have you tried simply giving
yourself some more stack space?  The following patch comes pretty much
straight from macppc's ofwboot and should double the amount of your
available stack space.

-allen


Index: Locore.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/ofppc/stand/ofwboot/Locore.c,v
retrieving revision 1.7
diff -u -r1.7 Locore.c
--- Locore.c	2002/09/18 01:45:04	1.7
+++ Locore.c	2002/10/25 01:57:21
@@ -43,7 +43,7 @@
 static void startup __P((void *, int, int (*)(void *), char *, int));
 static void setup __P((void));
 
-static int stack[1024];
+static int stack[8192/4 + 4];
 
 asm("
 	.text
@@ -60,8 +60,9 @@
 	sync
 	isync
 
-	lis	1,stack+4096-16@ha
-	addi	1,1,stack+4096-16@l
+	lis	1,stack@ha
+	addi	1,1,stack@l
+	addi	1,1,8192
 	b	startup
 ");
 

-- 
 Allen Briggs                     briggs@wasabisystems.com
 http://www.wasabisystems.com/    Quality NetBSD CDs, Sales, Support, Service
NetBSD development for Alpha, ARM, M68K, MIPS, PowerPC, SuperH, XScale, etc...