summaryrefslogtreecommitdiffstats
path: root/sys/boot/powerpc
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-10-16 10:46:22 +0000
committerobrien <obrien@FreeBSD.org>2000-10-16 10:46:22 +0000
commitd84d862cbd66f3f9ab4ce65fe69893664689c73b (patch)
treee051ab95c375090e547a86f54c45811bb79822a8 /sys/boot/powerpc
parentcecaff41fbf7d4fb5808812b72674971cd0a94dd (diff)
downloadFreeBSD-src-d84d862cbd66f3f9ab4ce65fe69893664689c73b.zip
FreeBSD-src-d84d862cbd66f3f9ab4ce65fe69893664689c73b.tar.gz
"Ok, my loader's now up to putting up a prompt. It probes disks partially
but can't boot from them yet." Thanks to Stephane Potvin for the some of the code in this set. Submitted by: Benno Rice <benno@jeamland.net>
Diffstat (limited to 'sys/boot/powerpc')
-rw-r--r--sys/boot/powerpc/Makefile5
-rw-r--r--sys/boot/powerpc/loader/Makefile116
-rw-r--r--sys/boot/powerpc/loader/help.ofw1
-rw-r--r--sys/boot/powerpc/loader/version6
-rw-r--r--sys/boot/powerpc/ofw/Makefile116
-rw-r--r--sys/boot/powerpc/ofw/help.ofw1
-rw-r--r--sys/boot/powerpc/ofw/version6
7 files changed, 251 insertions, 0 deletions
diff --git a/sys/boot/powerpc/Makefile b/sys/boot/powerpc/Makefile
new file mode 100644
index 0000000..f805d11
--- /dev/null
+++ b/sys/boot/powerpc/Makefile
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+SUBDIR= loader
+
+.include <bsd.subdir.mk>
diff --git a/sys/boot/powerpc/loader/Makefile b/sys/boot/powerpc/loader/Makefile
new file mode 100644
index 0000000..8576fbf
--- /dev/null
+++ b/sys/boot/powerpc/loader/Makefile
@@ -0,0 +1,116 @@
+# $FreeBSD$
+
+BASE= loader
+PROG= ${BASE}
+NOMAN=
+MAN1=
+NEWVERSWHAT= "bootstrap loader" OpenFirmware/PowerPC
+BINDIR?= /boot
+
+NOGCCERROR= YES
+
+# architecture-specific loader code
+SRCS= conf.c
+
+CFLAGS+= -DLOADER_DISK_SUPPORT
+
+.if !defined(NOFORTH)
+# Enable BootForth
+BOOT_FORTH= yes
+CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
+.if exists(${.OBJDIR}/../../ficl/libficl.a)
+LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
+.else
+LIBFICL= ${.CURDIR}/../../ficl/libficl.a
+.endif
+.endif
+
+# Always add MI sources
+.PATH: ${.CURDIR}/../../common
+.include <${.CURDIR}/../../common/Makefile.inc>
+CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
+
+CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help
+
+CFLAGS+= -Wall
+LDFLAGS= -nostdlib -static -Ttext 6c0000
+
+# OpenFirmware standalone support library
+LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a
+CFLAGS+= -I${.CURDIR}/../../ofw/libofw
+
+# where to get libstand from
+#XXX need a better way to do this
+LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
+#.if !exists(${LIBSTAND})
+#LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
+#.if !exists(${LIBSTAND})
+#LIBSTAND= -lstand
+#.endif
+#.endif
+CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
+
+# OpenFirmware is expecting ELF components
+CFLAGS+= -elf
+
+# New linker set code
+#CFLAGS+= -DNEW_LINKER_SET
+
+vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
+ sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
+ ${CC} -c vers.c
+
+${BASE}.help: help.common help.ofw
+ cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk \
+ > ${.TARGET}
+
+beforeinstall:
+.if exists(${DESTDIR}/boot/loader)
+ mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old
+.endif
+.if exists(${.OBJDIR}/loader.help)
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
+.else
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.CURDIR}/${BASE}.help ${DESTDIR}/boot
+.endif
+.if !exists(${DESTDIR}/boot/loader.rc)
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot
+.endif
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.CURDIR}/../../forth/support.4th ${DESTDIR}/boot
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.CURDIR}/../../forth/loader.conf ${DESTDIR}/boot/defaults
+
+${PROG}: ${OBJS} ${LIBOFW} ${LIBSTAND} ${LIBFICL} powerpc.o vers.o setdef0.o \
+ setdef1.o
+ ${LD} ${LDFLAGS} -o ${.TARGET} setdef0.o powerpc.o ${OBJS} setdef1.o \
+ vers.o ${LIBFICL} ${LIBOFW} ${LIBSTAND}
+
+setdef0.o: setdefs.h
+
+setdef1.o: setdefs.h
+
+# Cannot use ${OBJS} above this line
+.include <bsd.prog.mk>
+
+# If it's not there, don't consider it a target
+.if exists(${.CURDIR}/../../../ofw/include)
+beforedepend ${OBJS}: machine
+
+machine:
+ ln -sf ${.CURDIR}/../../../ofw/include machine
+
+.endif
+
+CLEANFILES+= machine setdefs.h setdef0.c setdef1.c setdef0.o setdef1.o \
+ powerpc.o
+
+.ORDER: setdefs.h setdef0.c setdef1.c
+setdefs.h setdef0.c setdef1.c: ${OBJS}
+ @echo Generating linker sets
+ @gensetdefs ${OBJS}
diff --git a/sys/boot/powerpc/loader/help.ofw b/sys/boot/powerpc/loader/help.ofw
new file mode 100644
index 0000000..5873eb0
--- /dev/null
+++ b/sys/boot/powerpc/loader/help.ofw
@@ -0,0 +1 @@
+$FreeBSD$
diff --git a/sys/boot/powerpc/loader/version b/sys/boot/powerpc/loader/version
new file mode 100644
index 0000000..cb0f693
--- /dev/null
+++ b/sys/boot/powerpc/loader/version
@@ -0,0 +1,6 @@
+$FreeBSD$
+
+NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
+file is important. Make sure the current version number is on line 6.
+
+0.1: Initial OFW/PowerPC version.
diff --git a/sys/boot/powerpc/ofw/Makefile b/sys/boot/powerpc/ofw/Makefile
new file mode 100644
index 0000000..8576fbf
--- /dev/null
+++ b/sys/boot/powerpc/ofw/Makefile
@@ -0,0 +1,116 @@
+# $FreeBSD$
+
+BASE= loader
+PROG= ${BASE}
+NOMAN=
+MAN1=
+NEWVERSWHAT= "bootstrap loader" OpenFirmware/PowerPC
+BINDIR?= /boot
+
+NOGCCERROR= YES
+
+# architecture-specific loader code
+SRCS= conf.c
+
+CFLAGS+= -DLOADER_DISK_SUPPORT
+
+.if !defined(NOFORTH)
+# Enable BootForth
+BOOT_FORTH= yes
+CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc
+.if exists(${.OBJDIR}/../../ficl/libficl.a)
+LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
+.else
+LIBFICL= ${.CURDIR}/../../ficl/libficl.a
+.endif
+.endif
+
+# Always add MI sources
+.PATH: ${.CURDIR}/../../common
+.include <${.CURDIR}/../../common/Makefile.inc>
+CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
+
+CLEANFILES+= vers.c vers.o ${BASE}.list ${BASE}.bin ${BASE}.sym ${BASE}.help
+
+CFLAGS+= -Wall
+LDFLAGS= -nostdlib -static -Ttext 6c0000
+
+# OpenFirmware standalone support library
+LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a
+CFLAGS+= -I${.CURDIR}/../../ofw/libofw
+
+# where to get libstand from
+#XXX need a better way to do this
+LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
+#.if !exists(${LIBSTAND})
+#LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
+#.if !exists(${LIBSTAND})
+#LIBSTAND= -lstand
+#.endif
+#.endif
+CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
+
+# OpenFirmware is expecting ELF components
+CFLAGS+= -elf
+
+# New linker set code
+#CFLAGS+= -DNEW_LINKER_SET
+
+vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
+ sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
+ ${CC} -c vers.c
+
+${BASE}.help: help.common help.ofw
+ cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk \
+ > ${.TARGET}
+
+beforeinstall:
+.if exists(${DESTDIR}/boot/loader)
+ mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old
+.endif
+.if exists(${.OBJDIR}/loader.help)
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
+.else
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.CURDIR}/${BASE}.help ${DESTDIR}/boot
+.endif
+.if !exists(${DESTDIR}/boot/loader.rc)
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot
+.endif
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.CURDIR}/../../forth/loader.4th ${DESTDIR}/boot
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.CURDIR}/../../forth/support.4th ${DESTDIR}/boot
+ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
+ ${.CURDIR}/../../forth/loader.conf ${DESTDIR}/boot/defaults
+
+${PROG}: ${OBJS} ${LIBOFW} ${LIBSTAND} ${LIBFICL} powerpc.o vers.o setdef0.o \
+ setdef1.o
+ ${LD} ${LDFLAGS} -o ${.TARGET} setdef0.o powerpc.o ${OBJS} setdef1.o \
+ vers.o ${LIBFICL} ${LIBOFW} ${LIBSTAND}
+
+setdef0.o: setdefs.h
+
+setdef1.o: setdefs.h
+
+# Cannot use ${OBJS} above this line
+.include <bsd.prog.mk>
+
+# If it's not there, don't consider it a target
+.if exists(${.CURDIR}/../../../ofw/include)
+beforedepend ${OBJS}: machine
+
+machine:
+ ln -sf ${.CURDIR}/../../../ofw/include machine
+
+.endif
+
+CLEANFILES+= machine setdefs.h setdef0.c setdef1.c setdef0.o setdef1.o \
+ powerpc.o
+
+.ORDER: setdefs.h setdef0.c setdef1.c
+setdefs.h setdef0.c setdef1.c: ${OBJS}
+ @echo Generating linker sets
+ @gensetdefs ${OBJS}
diff --git a/sys/boot/powerpc/ofw/help.ofw b/sys/boot/powerpc/ofw/help.ofw
new file mode 100644
index 0000000..5873eb0
--- /dev/null
+++ b/sys/boot/powerpc/ofw/help.ofw
@@ -0,0 +1 @@
+$FreeBSD$
diff --git a/sys/boot/powerpc/ofw/version b/sys/boot/powerpc/ofw/version
new file mode 100644
index 0000000..cb0f693
--- /dev/null
+++ b/sys/boot/powerpc/ofw/version
@@ -0,0 +1,6 @@
+$FreeBSD$
+
+NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
+file is important. Make sure the current version number is on line 6.
+
+0.1: Initial OFW/PowerPC version.
OpenPOWER on IntegriCloud