xref: /freebsd/stand/i386/boot0/Makefile (revision d8a0fe102c0cfdfcd5b818f850eff09d8536c9bc)
1# $FreeBSD$
2
3PROG?=	boot0
4STRIP=
5BINMODE=${NOBINMODE}
6MAN=
7SRCS=	${PROG}.S
8
9# Additional options that you can specify with make OPTS="..."
10# (these only apply to boot0.S)
11#
12#	-DVOLUME_SERIAL	support volume serial number (NT, XP, Vista)
13#	-DSIO		do I/O using COM1:
14#	-DPXE		fallback to INT18/PXE with F6
15#	-DCHECK_DRIVE	enable checking drive number
16#	-DONLY_F_KEYS	accept only Fx keys in console
17#	-DTEST		print drive number on entry
18#
19OPTS ?= -DVOLUME_SERIAL -DPXE
20CFLAGS += ${OPTS}
21
22# Flags used in the boot0.S code:
23#   0x0f	all valid partitions enabled.
24#   0x80	'packet', use BIOS EDD (LBA) extensions instead of CHS
25#		to read from disk. boot0.S does not check that the extensions
26#		are supported, but all modern BIOSes should have them.
27#   0x40	'noupdate', disable writing boot0 back to disk so that
28#		the current selection is not preserved across reboots.
29#   0x20	'setdrv', override the drive number supplied by the bios
30#		with the one in the boot sector.
31
32# Default boot flags:
33BOOT_BOOT0_FLAGS?=	0x8f
34
35# The number of timer ticks to wait for a keypress before assuming the default
36# selection.  Since there are 18.2 ticks per second, the default value of
37# 0xb6 (182d) corresponds to 10 seconds.
38BOOT_BOOT0_TICKS?=	0xb6
39
40# The base address that we the boot0 code to to run it.  Don't change this
41# unless you are glutton for punishment.
42BOOT_BOOT0_ORG?=	0x600
43ORG=${BOOT_BOOT0_ORG}
44
45# Comm settings for boot0sio.
46# Bit(s) Description
47# 7-5    data rate (110,150,300,600,1200,2400,4800,9600 bps)
48# 4-3    parity (00 or 10 = none, 01 = odd, 11 = even)
49# 2      stop bits (set = 2, clear = 1)
50# 1-0    data bits (00 = 5, 01 = 6, 10 = 7, 11 = 8)
51.if !defined(BOOT_BOOT0_COMCONSOLE_SPEED)
52BOOT_COMCONSOLE_SPEED?=	9600
53.if ${BOOT_COMCONSOLE_SPEED} == 9600
54BOOT_BOOT0_COMCONSOLE_SPEED=	"7 << 5 + 3"
55.elif ${BOOT_COMCONSOLE_SPEED} == 4800
56BOOT_BOOT0_COMCONSOLE_SPEED=	"6 << 5 + 3"
57.elif ${BOOT_COMCONSOLE_SPEED} == 2400
58BOOT_BOOT0_COMCONSOLE_SPEED=	"5 << 5 + 3"
59.elif ${BOOT_COMCONSOLE_SPEED} == 1200
60BOOT_BOOT0_COMCONSOLE_SPEED=	"4 << 5 + 3"
61.elif ${BOOT_COMCONSOLE_SPEED} == 600
62BOOT_BOOT0_COMCONSOLE_SPEED=	"3 << 5 + 3"
63.elif ${BOOT_COMCONSOLE_SPEED} == 300
64BOOT_BOOT0_COMCONSOLE_SPEED=	"2 << 5 + 3"
65.elif ${BOOT_COMCONSOLE_SPEED} == 150
66BOOT_BOOT0_COMCONSOLE_SPEED=	"1 << 5 + 3"
67.elif ${BOOT_COMCONSOLE_SPEED} == 110
68BOOT_BOOT0_COMCONSOLE_SPEED=	"0 << 5 + 3"
69.else
70BOOT_BOOT0_COMCONSOLE_SPEED=	"7 << 5 + 3"
71.endif
72.endif
73
74CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \
75	-DTICKS=${BOOT_BOOT0_TICKS} \
76	-DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED}
77
78LDFLAGS+=${LDFLAGS_BIN}
79
80.include <bsd.prog.mk>
81