5 .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC}
10 BOOT_COMCONSOLE_PORT?= 0x3f8
11 BOOT_COMCONSOLE_SPEED?= 9600
18 CFLAGS+=-DBOOTPROG=\"zfsboot\" \
21 -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
22 -DSIOFMT=${B2SIOFMT} \
23 -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
25 -I${BOOTSRC}/i386/common \
28 -I${SYSDIR}/crypto/skein \
29 -I${SYSDIR}/cddl/boot/zfs \
30 -I${BOOTSRC}/i386/boot2 \
31 -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \
32 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
33 -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings
35 CFLAGS.gcc+= --param max-inline-insns-single=100
37 LD_FLAGS+=${LD_FLAGS_BIN}
41 zfsboot: zfsboot1 zfsboot2
42 cat zfsboot1 zfsboot2 > zfsboot
44 CLEANFILES+= zfsboot1 zfsldr.out zfsldr.o
47 ${OBJCOPY} -S -O binary zfsldr.out ${.TARGET}
50 ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o
52 CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \
53 zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o
55 # We currently allow 256k bytes for zfsboot - in practice it could be
56 # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr.
61 @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \
62 echo "$$x bytes available"; test $$x -ge 0
63 ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync
65 zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
66 btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \
67 -o ${.TARGET} -P 1 zfsboot.bin
70 cp /dev/null ${.TARGET}
72 zfsboot.bin: zfsboot.out
73 ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
75 zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o
76 ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
80 .include <bsd.prog.mk>