summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-08-29 23:37:44 +0000
committerpeter <peter@FreeBSD.org>2002-08-29 23:37:44 +0000
commit3968b50cd269ef90a4ee7fe533933d211ed7062a (patch)
treee66810a508b22dc76dd35b5f2951b6a4cd38ce2b /sys/boot
parent8347fcb52dac051382b95182fce08ee0fc642340 (diff)
downloadFreeBSD-src-3968b50cd269ef90a4ee7fe533933d211ed7062a.zip
FreeBSD-src-3968b50cd269ef90a4ee7fe533933d211ed7062a.tar.gz
Try #2 at having /boot/loader default to ELF. Have pxeldr build its
own a.out version of loader.bin rather than depend on ../loader/loader being a.out.
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/i386/loader/Makefile2
-rw-r--r--sys/boot/i386/pxeldr/Makefile21
2 files changed, 19 insertions, 4 deletions
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index 68b6e21..b6c9fd8 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -89,7 +89,7 @@ vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
${CC} -c vers.c
${BASE}: ${BASE}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
- btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
+ btxld -v -f elf -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
-b ${BTXKERN} ${BASE}.bin
# /usr/bin/kzip ${.TARGET}
# mv ${.TARGET}.kz ${.TARGET}
diff --git a/sys/boot/i386/pxeldr/Makefile b/sys/boot/i386/pxeldr/Makefile
index d8d5b4e..e798824 100644
--- a/sys/boot/i386/pxeldr/Makefile
+++ b/sys/boot/i386/pxeldr/Makefile
@@ -6,6 +6,7 @@ ORG= 0x7c00
LDR= pxeldr
BOOT= pxeboot
+LOADER= loader
PROG= ${BOOT}
MAN= ${BOOT}.8
STRIP=
@@ -17,16 +18,30 @@ M4FLAGS+= -DPROBE_KEYBOARD
.endif
.if exists(${.OBJDIR}/../loader)
-LOADER= ${.OBJDIR}/../loader/loader
+LOADERBIN= ${.OBJDIR}/../loader/loader.bin
.else
-LOADER= ${.CURDIR}/../loader/loader
+LOADERBIN= ${.CURDIR}/../loader/loader.bin
.endif
+# BTX components
+.if exists(${.OBJDIR}/../btx)
+BTXDIR= ${.OBJDIR}/../btx
+.else
+BTXDIR= ${.CURDIR}/../btx
+.endif
+BTXLDR= ${BTXDIR}/btxldr/btxldr
+BTXKERN= ${BTXDIR}/btx/btx
+BTXCRT= ${BTXDIR}/lib/crt0.o
+
${BOOT}: ${LDR} ${LOADER}
cat ${LDR} ${LOADER} > ${.TARGET}.tmp
dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync
rm ${.TARGET}.tmp
+${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXKERN} ${BTXCRT}
+ btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
+ -b ${BTXKERN} ${LOADERBIN}
+
${LDR}: ${LDR}.o
.if ${OBJFORMAT} == aout
${LD} -nostdlib -N -s -T ${ORG} -o ${LDR}.out ${LDR}.o
@@ -40,6 +55,6 @@ ${LDR}.o: ${LDR}.s
(cd ${.CURDIR}; ${M4} ${M4FLAGS} ${LDR}.s) | \
${AS} ${AFLAGS} -o ${.TARGET}
-CLEANFILES+= ${LDR} ${LDR}.out ${LDR}.o ${BOOT}.tmp
+CLEANFILES+= ${LDR} ${LDR}.out ${LDR}.o ${BOOT}.tmp ${LOADER}
.include <bsd.prog.mk>
OpenPOWER on IntegriCloud