Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/arch/vax Makefile: Pullup revision 1.13



details:   https://anonhg.NetBSD.org/src/rev/f9a30df08812
branches:  netbsd-1-5
changeset: 488778:f9a30df08812
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jul 27 16:44:21 2000 +0000

description:
Makefile: Pullup revision 1.13
boot.c: Pullup revision 1.12
loadfile_machdep.h: Pullup revision 1.2
  Add support for loading elf kernels

diffstat:

 sys/arch/vax/boot/boot/Makefile         |   4 ++--
 sys/arch/vax/boot/boot/boot.c           |  15 +++++++++++++--
 sys/arch/vax/include/loadfile_machdep.h |  10 +++++-----
 3 files changed, 20 insertions(+), 9 deletions(-)

diffs (96 lines):

diff -r 12235477e6f0 -r f9a30df08812 sys/arch/vax/boot/boot/Makefile
--- a/sys/arch/vax/boot/boot/Makefile   Thu Jul 27 16:36:23 2000 +0000
+++ b/sys/arch/vax/boot/boot/Makefile   Thu Jul 27 16:44:21 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.10 2000/06/15 19:53:23 ragge Exp $
+#      $NetBSD: Makefile,v 1.10.2.1 2000/07/27 16:44:21 matt Exp $
 
 S=     ${.CURDIR}/../../../..
 
@@ -17,7 +17,7 @@
 MDEC_DIR=/usr/mdec
 
 SA_AS= library
-SAMISCMAKEFLAGS=SA_USE_CREAD=yes SA_INCLUDE_NET=yes
+SAMISCMAKEFLAGS=SA_USE_CREAD=yes SA_INCLUDE_NET=yes SA_USE_LOADFILE=yes
 .include "${S}/lib/libsa/Makefile.inc"
 LIBSA= ${SALIB}
 
diff -r 12235477e6f0 -r f9a30df08812 sys/arch/vax/boot/boot/boot.c
--- a/sys/arch/vax/boot/boot/boot.c     Thu Jul 27 16:36:23 2000 +0000
+++ b/sys/arch/vax/boot/boot/boot.c     Thu Jul 27 16:44:21 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.9 2000/05/26 20:15:21 ragge Exp $ */
+/*     $NetBSD: boot.c,v 1.9.4.1 2000/07/27 16:44:21 matt Exp $ */
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
  * All rights reserved.
@@ -37,6 +37,8 @@
 #include "sys/param.h"
 #include "sys/reboot.h"
 #include "lib/libsa/stand.h"
+#include "lib/libsa/loadfile.h"
+#include "lib/libkern/libkern.h"
 
 #define V750UCODE(x)    ((x>>8)&255)
 
@@ -95,6 +97,7 @@
 {
        int io;
        int j, nu;
+       u_long marks[MARK_MAX];
 
        /* First copy rpb/bqo to its new location */
        bcopy((caddr_t)prpb, &bootrpb, sizeof(struct rpb));
@@ -138,10 +141,18 @@
                int fileindex;
                for (fileindex = 0; filelist[fileindex].name[0] != '\0';
                    fileindex++) {
+                       int err;
                        errno = 0;
                        if (!filelist[fileindex].quiet)
                                printf("> boot %s\n", filelist[fileindex].name);
-                       exec(filelist[fileindex].name, 0, 0);
+                       marks[MARK_START] = 0;
+                       err = loadfile(filelist[fileindex].name, marks, LOAD_KERNEL|COUNT_KERNEL);
+                       if (err == 0) {
+                               machdep_start((char *)marks[MARK_ENTRY], 0,
+                                             (void *)marks[MARK_START],
+                                             (void *)marks[MARK_SYM],
+                                             (void *)marks[MARK_END]);
+                       }
                        if (!filelist[fileindex].quiet)
                                printf("%s: boot failed: %s\n", 
                                    filelist[fileindex].name, strerror(errno));
diff -r 12235477e6f0 -r f9a30df08812 sys/arch/vax/include/loadfile_machdep.h
--- a/sys/arch/vax/include/loadfile_machdep.h   Thu Jul 27 16:36:23 2000 +0000
+++ b/sys/arch/vax/include/loadfile_machdep.h   Thu Jul 27 16:44:21 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: loadfile_machdep.h,v 1.1 2000/05/25 20:25:23 matt Exp $         */
+/*     $NetBSD: loadfile_machdep.h,v 1.1.4.1 2000/07/27 16:44:21 matt Exp $     */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -43,11 +43,11 @@
 #define BOOT_ELF
 #define ELFSIZE 32
 
-#define LOAD_KERNEL    (LOAD_ALL & ~LOAD_TEXTA)
-#define COUNT_KERNEL   (COUNT_ALL & ~COUNT_TEXTA)
+#define LOAD_KERNEL    (LOAD_ALL & ~(LOAD_HDR|LOAD_TEXTA))
+#define COUNT_KERNEL   (COUNT_ALL & ~(COUNT_HDR|COUNT_TEXTA))
 
 #define LOADADDR(a)            (((u_long)(a)) + offset)
-#define ALIGNENTRY(a)          ((u_long)(a))
+#define ALIGNENTRY(a)          ((u_long)(a) & ~0xffffff)
 #define READ(f, b, c)          read((f), (void *)LOADADDR(b), (c))
 #define BCOPY(s, d, c)         memcpy((void *)LOADADDR(d), (void *)(s), (c))
 #define BZERO(d, c)            memset((void *)LOADADDR(d), 0, (c))
@@ -57,6 +57,6 @@
 #define PROGRESS(a)            (void) printf a
 #define ALLOC(a)               alloc(a)
 #define FREE(a, b)             free(a, b)
-#define OKMAGIC(a)             ((a) == OMAGIC)
+#define OKMAGIC(a)             ((a) == OMAGIC || (a) == NMAGIC)
 
 #endif /* !_VAX_LOADFILE_MACHDEP_H_ */



Home | Main Index | Thread Index | Old Index