Initial import from FreeBSD RELENG_4:
[dragonfly.git] / sys / boot / pc98 / boot2 / Makefile
1 # $FreeBSD: src/sys/boot/pc98/boot2/Makefile,v 1.4.2.2 2002/08/07 16:31:53 ru Exp $
2 #
3
4 PROG=   boot
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
8
9 BINDIR=         /boot
10 BINMODE=        444
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}/../../..
18
19
20 # By default, if a serial port is going to be used as console, use COM1
21 # (aka /dev/ttyd0).
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}
29
30 # feature not implemented
31 BOOT_COMCONSOLE_SPEED?=9600
32 CFLAGS+=        -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
33
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.
36 #CFLAGS+=       -DNAMEBLOCK
37 #CFLAGS+=       -DNAMEBLOCK_WRITEBACK
38
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
43 #
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).
51
52 CLEANFILES+=    boot.nohdr boot.strip boot1 boot2 sizetest
53 LDFLAGS+=       -N -Ttext 0 -nostdlib -e start
54 NOSHARED=       YES
55 NOMAN=
56 STRIP=
57
58 # tunable timeout parameter, waiting for keypress, calibrated in ms
59 BOOTWAIT?=      5000
60 # tunable timeout during string input, calibrated in ms
61 #TIMEOUT?=      30000
62
63 # Location that boot2 is loaded at
64 BOOTSEG=        0x1000
65
66 # Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned
67 BOOTSTACK=      0xFFF0
68
69 boot.nohdr:     boot
70         objcopy -S -O binary boot boot.nohdr
71         ls -l boot.nohdr
72
73 boot1:          boot.nohdr
74         dd if=boot.nohdr of=boot1 bs=512 count=1
75
76 boot2:          boot.nohdr
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 ; \
81                 rm boot2 ; \
82                 exit 2 ; \
83         fi
84
85 all:            boot1 boot2
86
87 install:
88         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
89                 boot1 boot2 ${DESTDIR}${BINDIR}
90
91 .include <bsd.kern.mk>
92 .include <bsd.prog.mk>