linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Olaf Hering <olh@suse.de>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] generate COFF zImage in arch/powerpc/boot
Date: Sat, 19 Nov 2005 21:47:42 +0100	[thread overview]
Message-ID: <20051119204742.GA17604@suse.de> (raw)
In-Reply-To: <20051119172900.GA11829@suse.de>

 On Sat, Nov 19, Olaf Hering wrote:

>  On Sat, Nov 19, Olaf Hering wrote:
> 
> > This patch on top of yours fixes it for me.
> 
> Another Makefile fix to actually include the kernel in the zImage.coff.

The kernel entry point should be printed unconditional. It helps
debugging the early init when it doesnt run at the link address.

My stack corruption was caused by a bug in call_prom_ret. It uses the
wrong pointer to clear the memory of the return values.

 arch/powerpc/boot/Makefile      |    2 ++
 arch/powerpc/boot/main.c        |   12 ++----------
 arch/powerpc/kernel/prom_init.c |    2 +-
 3 files changed, 5 insertions(+), 11 deletions(-)

Index: linux-2.6.15-rc1-olh/arch/powerpc/boot/Makefile
===================================================================
--- linux-2.6.15-rc1-olh.orig/arch/powerpc/boot/Makefile
+++ linux-2.6.15-rc1-olh/arch/powerpc/boot/Makefile
@@ -140,10 +140,12 @@ $(obj)/zImage.initrd.vmode: obj-boot += 
 $(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(srctree)/$(src)/zImage.lds
 	$(call cmd,bootld,$(obj-boot),zImage.lds)
 
+$(obj)/zImage.coff: obj-boot += $(call obj-sec, $(required))
 $(obj)/zImage: $(obj)/zImage.vmode $(obj)/zImage.coff $(obj)/addnote
 	@cp -f $< $@
 	$(call if_changed,addnote)
 
+$(obj)/zImage.initrd.coff: obj-boot += $(call obj-sec, $(required) $(initrd))
 $(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/zImage.initrd.coff $(obj)/addnote
 	@cp -f $< $@
 	$(call if_changed,addnote)
Index: linux-2.6.15-rc1-olh/arch/powerpc/boot/main.c
===================================================================
--- linux-2.6.15-rc1-olh.orig/arch/powerpc/boot/main.c
+++ linux-2.6.15-rc1-olh/arch/powerpc/boot/main.c
@@ -299,16 +299,8 @@ void start(unsigned long a1, unsigned lo
 	flush_cache((void *)vmlinux.addr, vmlinux.size);
 
 	kernel_entry = (kernel_entry_t)vmlinux.addr;
-#ifdef DEBUG
-	printf( "kernel:\n\r"
-		"        entry addr = 0x%lx\n\r"
-		"        a1         = 0x%lx,\n\r"
-		"        a2         = 0x%lx,\n\r"
-		"        prom       = 0x%lx,\n\r"
-		"        bi_recs    = 0x%lx,\n\r",
-		(unsigned long)kernel_entry, a1, a2,
-		(unsigned long)prom, NULL);
-#endif
+	printf( "entering kernel at 0x%08x(%x/%x/%08x)\n\r",
+		(unsigned long)kernel_entry, a1, a2, prom);
 
 	kernel_entry(a1, a2, prom, NULL);
 
Index: linux-2.6.15-rc1-olh/arch/powerpc/kernel/prom_init.c
===================================================================
--- linux-2.6.15-rc1-olh.orig/arch/powerpc/kernel/prom_init.c
+++ linux-2.6.15-rc1-olh/arch/powerpc/kernel/prom_init.c
@@ -265,7 +265,7 @@ static int __init call_prom_ret(const ch
 	va_end(list);
 
 	for (i = 0; i < nret; i++)
-		rets[nargs+i] = 0;
+		args.args[nargs+i] = 0;
 
 	if (enter_prom(&args, RELOC(prom_entry)) < 0)
 		return PROM_ERROR;

-- 
short story of a lazy sysadmin:
 alias appserv=wotan

  reply	other threads:[~2005-11-19 20:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-18  6:06 [PATCH] generate COFF zImage in arch/powerpc/boot Paul Mackerras
2005-11-18  7:51 ` Olaf Hering
2005-11-18 22:13   ` Olaf Hering
2005-11-18 23:16     ` Olaf Hering
2005-11-19  3:45     ` Paul Mackerras
2005-11-19  8:46       ` Olaf Hering
2005-11-19  9:12         ` Olaf Hering
2005-11-19 10:29       ` Olaf Hering
2005-11-19 17:29         ` Olaf Hering
2005-11-19 20:47           ` Olaf Hering [this message]
2005-11-23 20:21             ` Olaf Hering
2005-11-23 22:35               ` Paul Mackerras
2005-11-23 22:38                 ` Olaf Hering
2005-11-23 22:58                   ` Olaf Hering
2005-11-23 23:06                   ` Paul Mackerras
2005-12-10 18:31                 ` Olaf Hering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051119204742.GA17604@suse.de \
    --to=olh@suse.de \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).