5 # Order is very important on the SRCS line for this prog
6 SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S
7 SRCS+= probe_keyboard.c io.c disk.c sys.c
11 -fno-guess-branch-probability \
13 -D_KERNEL -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
14 CFLAGS+= -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
15 CFLAGS+= ${CWARNFLAGS}
16 CFLAGS+= -I${.CURDIR}/../../.. -I.
18 # By default, if a serial port is going to be used as console, use COM1
20 #BOOT_COMCONSOLE_PORT?=0x30
21 BOOT_COMCONSOLE_PORT?=0x238
22 BOOT_COMCONSOLE_CLK?=16
23 BOOT_COMCONSOLE_MODE=0x0c
24 CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \
25 -DCOMCONSOLE_CLK=${BOOT_COMCONSOLE_CLK} \
26 -DCOMCONSOLE_MODE=${BOOT_COMCONSOLE_MODE}
28 # feature not implemented
29 BOOT_COMCONSOLE_SPEED?=9600
30 CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
32 # Enable code to take the default boot string from a fixed location on the
33 # disk. See nextboot(8) and README.386BSD for more info.
35 #CFLAGS+= -DNAMEBLOCK_WRITEBACK
37 # Bias the conversion from the BIOS drive number to the FreeBSD unit number
38 # for hard disks. This may be useful for people booting in a mixed IDE/SCSI
39 # environment (set BOOT_HD_BIAS to the number of IDE drives).
40 #CFLAGS+= -DBOOT_HD_BIAS=1
42 # Details: this only applies if BOOT_HD_BIAS > 0. If the BIOS drive number
43 # for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to
44 # be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS). E.g.,
45 # BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:da(0,a) instead of
46 # 1:wd(1,a). If `da' is given explicitly, then the drive is assumed to be
47 # SCSI and have BIOS drive number (da_unit_number + BOOT_HD_BIAS). E.g.,
48 # BOOT_HD_BIAS=1 makes da(0,a) correspond to 1:da(0,a) instead of 0:da(0,a).
50 CLEANFILES+= boot.nohdr boot.strip boot.ldr boot1 boot2 sizetest
51 LDFLAGS+= -N -Ttext 0 -e start
56 # tunable timeout parameter, waiting for keypress, calibrated in ms
58 # tunable timeout during string input, calibrated in ms
61 # Location that boot2 is loaded at
64 # Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned
68 objcopy -S -O binary boot boot.nohdr
72 dd if=boot.nohdr of=boot.ldr bs=8192 count=1 conv=sync
75 dd if=boot.nohdr of=boot1 bs=512 count=1
78 dd if=boot.nohdr of=boot2 bs=512 skip=1
79 @dd if=boot2 skip=14 of=sizetest 2> /dev/null
80 @if [ -s sizetest ] ; then \
81 echo "boot2 is too big" >&2 ; \
86 all: boot.ldr boot1 boot2
89 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
90 boot.ldr ${DESTDIR}${BINDIR}/boot
91 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
92 boot1 boot2 ${DESTDIR}${BINDIR}
94 # If it's not there, don't consider it a target
95 .if exists(${.CURDIR}/../../../pc98/include)
96 beforedepend ${OBJS}: machine
99 ln -sf ${.CURDIR}/../../../pc98/include machine
103 .if exists(${.CURDIR}/../../../i386/include)
104 beforedepend ${OBJS}: i386
107 ln -sf ${.CURDIR}/../../../i386/include i386
111 CLEANFILES+= machine i386
113 .include "${.CURDIR}/../../../conf/kern.mk"
114 .include <bsd.prog.mk>