Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/stand/ofwboot Check in machinery to make ofw...



details:   https://anonhg.NetBSD.org/src/rev/c8ce12164f89
branches:  trunk
changeset: 521540:c8ce12164f89
user:      wrstuden <wrstuden%NetBSD.org@localhost>
date:      Fri Feb 01 18:45:29 2002 +0000

description:
Check in machinery to make ofwboot load at 600000, while ofwboot.elf
and ofwboot.xcf will load at 640000. The idea is that we can now
leave load-base at 600000, and it will work right for all three methods.

The problem is that the file loader and the net loader use load-base
as a scratch area, so if the executable really wants to load there,
the load fails.

diffstat:

 sys/arch/macppc/stand/ofwboot/Makefile |  34 ++++++++++++++++++++++------------
 sys/arch/macppc/stand/ofwboot/boot1.c  |   4 ++++
 2 files changed, 26 insertions(+), 12 deletions(-)

diffs (78 lines):

diff -r 9a0e0ae67626 -r c8ce12164f89 sys/arch/macppc/stand/ofwboot/Makefile
--- a/sys/arch/macppc/stand/ofwboot/Makefile    Fri Feb 01 18:16:03 2002 +0000
+++ b/sys/arch/macppc/stand/ofwboot/Makefile    Fri Feb 01 18:45:29 2002 +0000
@@ -1,10 +1,10 @@
-#      $NetBSD: Makefile,v 1.25 2002/01/07 23:09:53 matt Exp $
+#      $NetBSD: Makefile,v 1.26 2002/02/01 18:45:29 wrstuden Exp $
 
 S=     ${.CURDIR}/../../../..
 
 PROG=          ofwboot
 FILES=         ${PROG}.elf ${PROG}.xcf
-SRCS=          Locore.c boot.c ofdev.c hfs.c net.c netif_of.c vers.c
+SRCS=          Locore.c ofdev.c hfs.c net.c netif_of.c vers.c
 XCOFFXTRA=     Xcoffxtra.c
 XCOFFXTRAOBJ=  Xcoffxtra.o
 CFLAGS+=       -msoft-float -Wno-main
@@ -37,17 +37,19 @@
 
 # For now...
 #RELOC=                20000
-RELOC=         600000
+RELOC=         640000
+RELOC_FLATFILE=        600000
 
 ENTRY=         _start
 
-CLEANFILES+=   vers.c ${PROG}.elf ${PROG}.mrg ${PROG}.xcf machine powerpc
+CLEANFILES+=   vers.c ${PROG}.elf ${PROG}.el1 ${PROG}.mrg ${PROG}.xcf
+CLEANFILES+=   machine powerpc
 
 CPPFLAGS+=     -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
-CPPFLAGS+=     -DRELOC=0x${RELOC}
+CPPFLAGS+=     -DRELOC=0x${RELOC} -DRELOC_FLATFILE=0x${RELOC_FLATFILE}
 #CPPFLAGS+=    -DXCOFF_GLUE            # for booting PCI Powermacs
 
-CLEANFILES+= ${XCOFFXTRAOBJ}
+CLEANFILES+= ${XCOFFXTRAOBJ} boot.o boot1.o
 
 .BEGIN:
        @[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine
@@ -75,15 +77,23 @@
 vers.c: version
        sh ${S}/conf/newvers_stand.sh ${.CURDIR}/version "macppc" ${NEWVERSWHAT}
 
-${PROG}: ${OBJS} ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN} ${FIXCOFFTARG}
+all: ${PROG} ${PROG}.xcf ${PROG}.elf
+
+${PROG}: ${OBJS} boot1.o ${LIBSA} ${LIBZ} ${LIBKERN} 
+       ${LD} -s -N -Ttext ${RELOC_FLATFILE} -Bstatic -o ${PROG}.el1 \
+           ${OBJS} boot1.o ${LIBSA} ${LIBZ} ${LIBKERN}
+       ${OBJCOPY} -O binary ${PROG}.el1 ${PROG}
+
+.include <bsd.prog.mk>
+
+${PROG}.elf: ${OBJS} boot.o ${LIBSA} ${LIBZ} ${LIBKERN}
        ${LD} -s -N -Ttext ${RELOC} -Bstatic -o ${PROG}.elf \
-           ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
-       ${OBJCOPY} -O binary ${PROG}.elf ${PROG}
+           ${OBJS} boot.o ${LIBSA} ${LIBZ} ${LIBKERN}
+
+${PROG}.xcf: ${OBJS} boot.o ${XCOFFXTRAOBJ} ${LIBSA} ${LIBZ} ${LIBKERN} ${FIXCOFFTARG}
        ${LD} -s -N -T ${.CURDIR}/../fixcoff/elf32_powerpc_merge.x -e _entry \
            -Ttext ${RELOC} -Bstatic -o ${PROG}.mrg  ${XCOFFXTRAOBJ} \
-           ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN}
+           ${OBJS} boot.o ${LIBSA} ${LIBZ} ${LIBKERN}
        ${OBJCOPY} -O aixcoff-rs6000 -R .comment -R .note \
            ${PROG}.mrg ${PROG}.xcf
        ${FIXCOFF} ${PROG}.xcf
-
-.include <bsd.prog.mk>
diff -r 9a0e0ae67626 -r c8ce12164f89 sys/arch/macppc/stand/ofwboot/boot1.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/macppc/stand/ofwboot/boot1.c     Fri Feb 01 18:45:29 2002 +0000
@@ -0,0 +1,4 @@
+#undef RELOC
+#define RELOC RELOC_FLATFILE
+
+#include "boot.c"



Home | Main Index | Thread Index | Old Index