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