1997-02-22 09:48:43 +00:00
|
|
|
# $Id$
|
1993-06-12 14:58:17 +00:00
|
|
|
#
|
|
|
|
|
1994-10-02 05:18:26 +00:00
|
|
|
PROG= boot
|
|
|
|
# Order is very important on the SRCS line for this prog
|
1995-01-20 07:48:27 +00:00
|
|
|
SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S
|
|
|
|
SRCS+= probe_keyboard.c io.c disk.c sys.c
|
1994-10-02 05:18:26 +00:00
|
|
|
|
|
|
|
BINDIR= /usr/mdec
|
|
|
|
BINMODE= 444
|
1996-10-08 22:35:48 +00:00
|
|
|
CFLAGS= -O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
|
1996-01-21 11:30:12 +00:00
|
|
|
-DDO_BAD144 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
|
1994-10-06 09:41:05 +00:00
|
|
|
CFLAGS+= -DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
|
1996-11-23 07:38:25 +00:00
|
|
|
CFLAGS+= -I${.CURDIR}/../../..
|
1996-10-08 22:18:34 +00:00
|
|
|
CFLAGS+= ${CWARNFLAGS}
|
1995-04-14 21:26:53 +00:00
|
|
|
|
1996-03-08 06:29:07 +00:00
|
|
|
# Probe the keyboard and use the serial console if the keyboard isn't found.
|
1996-10-14 17:25:53 +00:00
|
|
|
.if defined(BOOT_PROBE_KEYBOARD)
|
|
|
|
CFLAGS+= -DPROBE_KEYBOARD
|
|
|
|
.endif
|
1996-03-08 06:29:07 +00:00
|
|
|
|
1996-10-08 22:41:34 +00:00
|
|
|
# Probe the keyboard lock and use the serial console if the keyboard is locked.
|
1996-10-14 17:25:53 +00:00
|
|
|
.if defined(BOOT_PROBE_KEYBOARD_LOCK)
|
|
|
|
CFLAGS+= -DPROBE_KEYBOARD_LOCK
|
|
|
|
.endif
|
1996-10-08 22:41:34 +00:00
|
|
|
|
1996-10-14 12:37:47 +00:00
|
|
|
# Force use of the serial console.
|
1996-10-14 17:25:53 +00:00
|
|
|
.if defined(BOOT_FORCE_COMCONSOLE)
|
|
|
|
CFLAGS+= -DFORCE_COMCONSOLE
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# By default, if a serial port is going to be used as console, use COM1
|
|
|
|
# (aka /dev/ttyd0).
|
|
|
|
BOOT_COMCONSOLE_PORT?=0x3F8
|
|
|
|
CFLAGS+= -DCOMCONSOLE=${BOOT_COMCONSOLE_PORT}
|
1995-04-14 21:26:53 +00:00
|
|
|
|
1996-11-02 02:24:39 +00:00
|
|
|
BOOT_COMCONSOLE_SPEED?=9600
|
|
|
|
CFLAGS+= -DCONSPEED=${BOOT_COMCONSOLE_SPEED}
|
|
|
|
|
1996-07-09 02:28:20 +00:00
|
|
|
# Enable code to take the default boot string from a fixed location on the
|
1996-07-12 05:17:37 +00:00
|
|
|
# disk. See nextboot(8) and README.386BSD for more info.
|
1996-07-09 02:28:20 +00:00
|
|
|
#CFLAGS+= -DNAMEBLOCK
|
|
|
|
#CFLAGS+= -DNAMEBLOCK_WRITEBACK
|
|
|
|
|
1996-04-07 14:28:05 +00:00
|
|
|
# Bias the conversion from the BIOS drive number to the FreeBSD unit number
|
1996-05-11 04:27:24 +00:00
|
|
|
# for hard disks. This may be useful for people booting in a mixed IDE/SCSI
|
|
|
|
# environment (set BOOT_HD_BIAS to the number of IDE drives).
|
1996-04-07 14:28:05 +00:00
|
|
|
#CFLAGS+= -DBOOT_HD_BIAS=1
|
1996-05-11 04:27:24 +00:00
|
|
|
#
|
|
|
|
# Details: this only applies if BOOT_HD_BIAS > 0. If the BIOS drive number
|
|
|
|
# for the boot drive is >= BOOT_HD_BIAS, then the boot drive is assumed to
|
|
|
|
# be SCSI and have unit number (BIOS_drive_number - BOOT_HD_BIAS). E.g.,
|
|
|
|
# BOOT_HD_BIAS=1 makes BIOS drive 1 correspond to 1:sd(0,a) instead of
|
|
|
|
# 1:wd(1,a). If `sd' is given explicitly, then the drive is assumed to be
|
|
|
|
# SCSI and have BIOS drive number (sd_unit_number + BOOT_HD_BIAS). E.g.,
|
|
|
|
# BOOT_HD_BIAS=1 makes sd(0,a) correspond to 1:sd(0,a) instead of 0:sd(0,a).
|
1996-01-06 23:37:10 +00:00
|
|
|
|
1995-04-20 18:36:14 +00:00
|
|
|
CLEANFILES+= boot.nohdr boot.strip boot1 boot2 sizetest
|
1994-10-02 05:18:26 +00:00
|
|
|
DPADD= ${LIBC}
|
|
|
|
LDFLAGS+= -N -T 0 -nostdlib
|
|
|
|
LDADD= -lc
|
1995-03-28 19:22:43 +00:00
|
|
|
#LINKS= ${BINDIR}/sdboot ${BINDIR}/wdboot\
|
|
|
|
# ${BINDIR}/sdboot ${BINDIR}/fdboot\
|
|
|
|
# ${BINDIR}/bootsd ${BINDIR}/bootwd\
|
|
|
|
# ${BINDIR}/bootsd ${BINDIR}/bootfd
|
1994-10-02 05:18:26 +00:00
|
|
|
NOSHARED= YES
|
|
|
|
NOMAN=
|
|
|
|
STRIP=
|
1993-07-13 18:15:32 +00:00
|
|
|
|
1996-01-21 11:30:12 +00:00
|
|
|
# tunable timeout parameter, waiting for keypress, calibrated in ms
|
1994-09-20 22:25:00 +00:00
|
|
|
BOOTWAIT?= 5000
|
1996-01-21 11:30:12 +00:00
|
|
|
# tunable timeout during string input, calibrated in ms
|
|
|
|
#TIMEOUT?= 30000
|
1993-06-12 14:58:17 +00:00
|
|
|
|
1994-10-06 09:41:05 +00:00
|
|
|
# Location that boot2 is loaded at
|
|
|
|
BOOTSEG= 0x1000
|
|
|
|
|
|
|
|
# Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned
|
|
|
|
BOOTSTACK= 0xFFF0
|
|
|
|
|
1994-10-02 05:18:26 +00:00
|
|
|
boot.strip: boot
|
|
|
|
cp -p boot boot.strip
|
|
|
|
strip boot.strip
|
|
|
|
size boot.strip
|
1993-06-12 14:58:17 +00:00
|
|
|
|
1994-10-02 05:18:26 +00:00
|
|
|
boot.nohdr: boot.strip
|
|
|
|
dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
|
|
|
|
ls -l boot.nohdr
|
1993-06-12 14:58:17 +00:00
|
|
|
|
1994-10-02 05:18:26 +00:00
|
|
|
boot1: boot.nohdr
|
|
|
|
dd if=boot.nohdr of=boot1 bs=512 count=1
|
1993-06-12 14:58:17 +00:00
|
|
|
|
1994-10-02 05:18:26 +00:00
|
|
|
boot2: boot.nohdr
|
|
|
|
dd if=boot.nohdr of=boot2 bs=512 skip=1
|
1996-09-05 21:12:06 +00:00
|
|
|
@dd if=boot2 skip=14 of=sizetest 2> /dev/null
|
1995-04-20 23:15:10 +00:00
|
|
|
@if [ -s sizetest ] ; then \
|
1996-09-07 21:16:44 +00:00
|
|
|
echo "boot2 is too big" >&2 ; \
|
|
|
|
rm boot2 ; \
|
|
|
|
exit 2 ; \
|
1995-04-20 18:36:14 +00:00
|
|
|
fi
|
1993-06-12 14:58:17 +00:00
|
|
|
|
1994-10-02 05:18:26 +00:00
|
|
|
all: boot1 boot2
|
1993-06-12 14:58:17 +00:00
|
|
|
|
1995-03-28 19:22:43 +00:00
|
|
|
install:
|
1995-07-25 00:37:58 +00:00
|
|
|
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
|
1995-03-28 19:22:43 +00:00
|
|
|
boot1 ${DESTDIR}${BINDIR}/boot1
|
1995-07-25 00:37:58 +00:00
|
|
|
${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}\
|
1995-03-28 19:22:43 +00:00
|
|
|
boot2 ${DESTDIR}${BINDIR}/boot2
|
1996-02-03 21:12:27 +00:00
|
|
|
for i in sd fd wd od vn ; do \
|
1995-03-28 19:22:43 +00:00
|
|
|
( cd ${DESTDIR}${BINDIR} ; \
|
|
|
|
rm -f boot$${i} $${i}boot ; \
|
|
|
|
ln -s boot1 $${i}boot ; \
|
|
|
|
ln -s boot2 boot$${i} ; ) \
|
|
|
|
done
|
1995-01-24 00:41:50 +00:00
|
|
|
|
1996-10-08 22:18:34 +00:00
|
|
|
.include <bsd.kern.mk>
|
1993-07-13 18:15:32 +00:00
|
|
|
.include <bsd.prog.mk>
|