1# $FreeBSD: src/sys/boot/i386/boot0/Makefile,v 1.17 2002/09/17 01:48:54 peter Exp $ 2 3PROG?= boot0 4NOMAN= 5STRIP= 6BINDIR?= /boot 7BINMODE= 444 8 9NXCFLAGS= 10NXLDFLAGS= 11 12.PATH: ${.CURDIR}/.. 13 14# The default set of flags compiled into boot0. This enables update (writing 15# the modified boot0 back to disk after running so that the selection made is 16# saved), packet mode (detect and use the BIOS EDD extensions if we try to 17# boot past the 1024 cylinder limit), and booting from all valid slices. 18BOOT_BOOT0_FLAGS?= 0x8f 19 20# The number of timer ticks to wait for a keypress before assuming the default 21# selection. Since there are 18.2 ticks per second, the default value of 22# 0xb6 (182d) corresponds to 10 seconds. 23BOOT_BOOT0_TICKS?= 0xb6 24 25# Comm settings for boot0sio 26# 27# (bios int 0x14 doesn't support baud rates above 9600). 28# 29# Bit(s) Description 30# 7-5 data rate (110,150,300,600,1200,2400,4800,9600 bps) 31# 4-3 parity (00 or 10 = none, 01 = odd, 11 = even) 32# 2 stop bits (set = 2, clear = 1) 33# 1-0 data bits (00 = 5, 01 = 6, 10 = 7, 11 = 8) 34.if !defined(BOOT_BOOT0_COMCONSOLE_SPEED) 35BOOT_COMCONSOLE_SPEED?= 115200 36.if ${BOOT_COMCONSOLE_SPEED} == 9600 37BOOT_BOOT0_COMCONSOLE_SPEED= "7 << 5 + 3" 38.elif ${BOOT_COMCONSOLE_SPEED} == 4800 39BOOT_BOOT0_COMCONSOLE_SPEED= "6 << 5 + 3" 40.elif ${BOOT_COMCONSOLE_SPEED} == 2400 41BOOT_BOOT0_COMCONSOLE_SPEED= "5 << 5 + 3" 42.elif ${BOOT_COMCONSOLE_SPEED} == 1200 43BOOT_BOOT0_COMCONSOLE_SPEED= "4 << 5 + 3" 44.elif ${BOOT_COMCONSOLE_SPEED} == 600 45BOOT_BOOT0_COMCONSOLE_SPEED= "3 << 5 + 3" 46.elif ${BOOT_COMCONSOLE_SPEED} == 300 47BOOT_BOOT0_COMCONSOLE_SPEED= "2 << 5 + 3" 48.elif ${BOOT_COMCONSOLE_SPEED} == 150 49BOOT_BOOT0_COMCONSOLE_SPEED= "1 << 5 + 3" 50.elif ${BOOT_COMCONSOLE_SPEED} == 110 51BOOT_BOOT0_COMCONSOLE_SPEED= "0 << 5 + 3" 52.else 53BOOT_BOOT0_COMCONSOLE_SPEED= "7 << 5 + 3" 54.endif 55.endif 56 57CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \ 58 -DTICKS=${BOOT_BOOT0_TICKS} \ 59 -DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} 60 61# pull BOOT0_ORIGIN out of bootasm.h 62# 63REL0 = `${.OBJDIR}/../asmdef/bootasmdef.nx BOOT0_ORIGIN` 64 65${PROG}: boot0.o bootasm.h 66 @echo "NOTE: boot0 origin set to ${REL0}" 67 ${LD} ${LDFLAGS:N-Wl,*} -N -e start -Ttext ${REL0} -o boot0.out boot0.o 68 objcopy -S -O binary boot0.out ${.TARGET} 69 70boot0.o: boot0.S 71 ${CC} -c ${CFLAGS} ${BOOT_CCASM_FLAGS} ${.IMPSRC} -o ${.TARGET} 72 73CLEANFILES+= boot0.out boot0.o 74 75.include <bsd.prog.mk> 76