1 # $FreeBSD: src/sys/boot/pc98/boot2/Makefile,v 1.4.2.2 2002/08/07 16:31:53 ru Exp $
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 CFLAGS= -elf -Os -fno-builtin -fforce-addr -fdata-sections \
12 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
13 -mpreferred-stack-boundary=2 -mrtd \
14 -DPC98 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
15 CFLAGS+= -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
16 CFLAGS+= ${CWARNFLAGS}
17 CFLAGS+= -I${.CURDIR}/../../..
20 # By default, if a serial port is going to be used as console, use COM1
22 #BOOT_COMCONSOLE_PORT?=0x30
23 BOOT_COMCONSOLE_PORT?=0x238
24 BOOT_COMCONSOLE_CLK?=16
25 BOOT_COMCONSOLE_MODE=0x0c
26 CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \
27 -DCOMCONSOLE_CLK=${BOOT_COMCONSOLE_CLK} \
28 -DCOMCONSOLE_MODE=${BOOT_COMCONSOLE_MODE}
30 # feature not implemented
31 BOOT_COMCONSOLE_SPEED?=9600
32 CFLAGS+= -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
34 # Enable code to take the default boot string from a fixed location on the
35 # disk. See nextboot(8) and README.386BSD for more info.
37 #CFLAGS+= -DNAMEBLOCK_WRITEBACK
39 # Bias the conversion from the BIOS drive number to the FreeBSD unit number
40 # for hard disks. This may be useful for people booting in a mixed IDE/SCSI
41 # environment (set BOOT_HD_BIAS to the number of IDE drives).
42 #CFLAGS+= -DBOOT_HD_BIAS=1
44 # Details: this only applies if BOOT_HD_BIAS > 0. If the BIOS drive number
45 # for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to
46 # be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS). E.g.,
47 # BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:da(0,a) instead of
48 # 1:wd(1,a). If `da' is given explicitly, then the drive is assumed to be
49 # SCSI and have BIOS drive number (da_unit_number + BOOT_HD_BIAS). E.g.,
50 # BOOT_HD_BIAS=1 makes da(0,a) correspond to 1:da(0,a) instead of 0:da(0,a).
52 CLEANFILES+= boot.nohdr boot.strip boot1 boot2 sizetest
53 LDFLAGS+= -N -Ttext 0 -nostdlib -e start
58 # tunable timeout parameter, waiting for keypress, calibrated in ms
60 # tunable timeout during string input, calibrated in ms
63 # Location that boot2 is loaded at
66 # Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned
70 objcopy -S -O binary boot boot.nohdr
74 dd if=boot.nohdr of=boot1 bs=512 count=1
77 dd if=boot.nohdr of=boot2 bs=512 skip=1
78 @dd if=boot2 skip=14 of=sizetest 2> /dev/null
79 @if [ -s sizetest ] ; then \
80 echo "boot2 is too big" >&2 ; \
88 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
89 boot1 boot2 ${DESTDIR}${BINDIR}
91 .include <bsd.kern.mk>
92 .include <bsd.prog.mk>