1.include <bsd.init.mk> 2 3PROG= boot1.elf 4NEWVERSWHAT= "Open Firmware boot block" ${MACHINE_ARCH} 5INSTALLFLAGS= -b 6 7FILES= boot1.hfs 8SRCS= boot1.c ashldi3.c syncicache.c memset.c 9 10CFLAGS+=-I${LDRSRC} 11# Load boot1.elf below kernel. 12# 13# Due to limitiations in the way we load stuff, we have to avoid reusing 14# memory until the kernel MMU code has taken over. 15# 16# 0x38000 is high enough to not interfere with the trap area, but low 17# enough that it doesn't bump into the kernel area starting at 0x100000, 18# even if the entire partition gets used as the load size by a buggy OFW. 19# 20# In theory 0xf0000 would work too under the current 64k size limit for 21# boot1.elf defined in the HFS template, but sometimes boot1.elf is written 22# directly to the PReP partition. 23# 24LDFLAGS=-nostdlib -static -Wl,-N -Wl,-Ttext=0x38000 25 26.PATH: ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR} 27 28# The following inserts out objects into a template HFS 29# created by generate-hfs.sh 30 31.include "${.CURDIR}/Makefile.hfs" 32 33boot1.hfs: boot1.elf bootinfo.txt 34 echo ${.OBJDIR} 35 uudecode ${.CURDIR}/hfs.tmpl.bz2.uu 36 mv hfs.tmpl.bz2 ${.TARGET}.bz2 37 bzip2 -f -d ${.TARGET}.bz2 38 ${DD} if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc 39 ${DD} if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ 40 conv=notrunc 41 42CLEANFILES+= boot1.hfs 43 44MK_PIE= no 45 46.include <bsd.prog.mk> 47 48