Initial import from FreeBSD RELENG_4:
[games.git] / sys / platform / pc32 / boot / biosboot / Makefile
1 # $FreeBSD: src/sys/i386/boot/biosboot/Makefile,v 1.70.2.2 2002/08/07 16:31:55 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 BINMODE=        444
10 CFLAGS=         -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
11                 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
12 CFLAGS+=        -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
13 CFLAGS+=        ${CWARNFLAGS}
14
15 # By default, if a serial port is going to be used as console, use COM1
16 # (aka /dev/ttyd0).
17 BOOT_COMCONSOLE_PORT?=0x3F8
18 CFLAGS+=        -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT}
19
20 BOOT_COMCONSOLE_SPEED?=9600
21 CFLAGS+=        -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
22
23 # Enable code to take the default boot string from a fixed location on the
24 # disk.  See nextboot(8) and README.386BSD for more info.
25 #CFLAGS+=       -DNAMEBLOCK
26 #CFLAGS+=       -DNAMEBLOCK_WRITEBACK
27
28 # Bias the conversion from the BIOS drive number to the FreeBSD unit number
29 # for hard disks.  This may be useful for people booting in a mixed IDE/SCSI
30 # environment (set BOOT_HD_BIAS to the number of IDE drives).
31 #CFLAGS+=       -DBOOT_HD_BIAS=1
32 #
33 # Details: this only applies if BOOT_HD_BIAS > 0.  If the BIOS drive number
34 # for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to
35 # be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS).  E.g.,
36 # BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:da(0,a) instead of
37 # 1:wd(1,a).  If `da' is given explicitly, then the drive is assumed to be
38 # SCSI and have BIOS drive number (da_unit_number + BOOT_HD_BIAS).  E.g.,
39 # BOOT_HD_BIAS=1 makes da(0,a) correspond to 1:da(0,a) instead of 0:da(0,a).
40
41 CLEANFILES+=    boot.nohdr boot.strip boot1 boot2 sizetest
42 LDFLAGS+=       -N -T 0 -nostdlib
43 NOSHARED=       YES
44 NOMAN=
45 STRIP=
46
47 # tunable timeout parameter, waiting for keypress, calibrated in ms
48 BOOTWAIT?=      5000
49 # tunable timeout during string input, calibrated in ms
50 #TIMEOUT?=      30000
51
52 # Location that boot2 is loaded at
53 BOOTSEG=        0x1000
54
55 # Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned
56 BOOTSTACK=      0xFFF0
57
58 boot.strip:     boot
59         cp -p boot boot.strip
60         strip -aout boot.strip
61         size -aout boot.strip
62
63 boot.nohdr:     boot.strip
64         dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
65         ls -l boot.nohdr
66
67 boot1:          boot.nohdr
68         dd if=boot.nohdr of=boot1 bs=512 count=1
69
70 boot2:          boot.nohdr
71         dd if=boot.nohdr of=boot2 bs=512 skip=1
72         @dd if=boot2 skip=14 of=sizetest 2> /dev/null
73         @if [ -s sizetest ] ; then \
74                 echo "boot2 is too big" >&2 ; \
75                 rm boot2 ; \
76                 exit 2 ; \
77         fi
78
79 all:            boot1 boot2
80
81 install:
82         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
83                 boot1 boot2 ${DESTDIR}${BINDIR}/
84
85 install-boothelp:
86         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
87                 ${.CURDIR}/boot.help ${DESTDIR}/
88
89 .include <bsd.kern.mk>
90 .include <bsd.prog.mk>