Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/zaurus/stand/zbsdmod Make sure to clear bss before ...



details:   https://anonhg.NetBSD.org/src/rev/f9bd0019851f
branches:  trunk
changeset: 460581:f9bd0019851f
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Mon Oct 28 15:26:09 2019 +0000

description:
Make sure to clear bss before jumping to a kernel copied from load buffer.

This will fix yet another boot failure issue
"screen white-out after loading a kernel"
 https://mail-index.netbsd.org/port-zaurus/2019/10/26/msg000072.html

Should be pulled up to netbsd-8 and netbsd-9.

diffstat:

 sys/arch/zaurus/stand/zbsdmod/compat_linux.h |  3 ++-
 sys/arch/zaurus/stand/zbsdmod/zbsdmod.c      |  6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 5f0c573ccb36 -r f9bd0019851f sys/arch/zaurus/stand/zbsdmod/compat_linux.h
--- a/sys/arch/zaurus/stand/zbsdmod/compat_linux.h      Mon Oct 28 14:20:28 2019 +0000
+++ b/sys/arch/zaurus/stand/zbsdmod/compat_linux.h      Mon Oct 28 15:26:09 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_linux.h,v 1.6 2011/12/11 14:05:39 nonaka Exp $  */
+/*     $NetBSD: compat_linux.h,v 1.7 2019/10/28 15:26:09 tsutsui Exp $ */
 /*     $OpenBSD: compat_linux.h,v 1.5 2006/01/15 17:58:27 deraadt Exp $        */
 
 /*
@@ -64,6 +64,7 @@
 extern int unregister_chrdev(unsigned int, const char *);
 extern void printk(const char *, ...) __printflike(1, 2);
 extern void *memcpy(void *, const void *, size_t);
+extern void *memset(void *, int, size_t);
 
 /* procfs support */
 struct proc_dir_entry {
diff -r 5f0c573ccb36 -r f9bd0019851f sys/arch/zaurus/stand/zbsdmod/zbsdmod.c
--- a/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c   Mon Oct 28 14:20:28 2019 +0000
+++ b/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c   Mon Oct 28 15:26:09 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zbsdmod.c,v 1.10 2019/10/26 09:58:40 tsutsui Exp $     */
+/*     $NetBSD: zbsdmod.c,v 1.11 2019/10/28 15:26:09 tsutsui Exp $     */
 /*     $OpenBSD: zbsdmod.c,v 1.7 2005/05/02 02:45:29 uwe Exp $ */
 
 /*
@@ -262,6 +262,10 @@
                                    (((char *)elf) + phdr[i].p_offset)[sz];
                        }
                }
+               if (IS_BSS(phdr[i])) {
+                       memset((void *)(phdr[i].p_vaddr + phdr[i].p_filesz), 0,
+                           phdr[i].p_memsz - phdr[i].p_filesz);
+               }
        }
 
        addr = (int *)(elf->e_entry);



Home | Main Index | Thread Index | Old Index