1ca987d46SWarner Losh# $FreeBSD$ 2ca987d46SWarner Losh 3ca987d46SWarner LoshPROG?= boot0 4ca987d46SWarner LoshSTRIP= 5ca987d46SWarner LoshBINMODE=${NOBINMODE} 6ca987d46SWarner LoshSRCS= ${PROG}.S 7ca987d46SWarner Losh 8ca987d46SWarner Losh# Additional options that you can specify with make OPTS="..." 9ca987d46SWarner Losh# (these only apply to boot0.S) 10ca987d46SWarner Losh# 11ca987d46SWarner Losh# -DVOLUME_SERIAL support volume serial number (NT, XP, Vista) 12ca987d46SWarner Losh# -DSIO do I/O using COM1: 13ca987d46SWarner Losh# -DPXE fallback to INT18/PXE with F6 14ca987d46SWarner Losh# -DCHECK_DRIVE enable checking drive number 15ca987d46SWarner Losh# -DONLY_F_KEYS accept only Fx keys in console 16ca987d46SWarner Losh# -DTEST print drive number on entry 17ca987d46SWarner Losh# 18ca987d46SWarner LoshOPTS ?= -DVOLUME_SERIAL -DPXE 19ca987d46SWarner LoshCFLAGS += ${OPTS} 20ca987d46SWarner Losh 21ca987d46SWarner Losh# Flags used in the boot0.S code: 22ca987d46SWarner Losh# 0x0f all valid partitions enabled. 23ca987d46SWarner Losh# 0x80 'packet', use BIOS EDD (LBA) extensions instead of CHS 24ca987d46SWarner Losh# to read from disk. boot0.S does not check that the extensions 25ca987d46SWarner Losh# are supported, but all modern BIOSes should have them. 26ca987d46SWarner Losh# 0x40 'noupdate', disable writing boot0 back to disk so that 27ca987d46SWarner Losh# the current selection is not preserved across reboots. 28ca987d46SWarner Losh# 0x20 'setdrv', override the drive number supplied by the bios 29ca987d46SWarner Losh# with the one in the boot sector. 30ca987d46SWarner Losh 31ca987d46SWarner Losh# Default boot flags: 32ca987d46SWarner LoshBOOT_BOOT0_FLAGS?= 0x8f 33ca987d46SWarner Losh 34ca987d46SWarner Losh# The number of timer ticks to wait for a keypress before assuming the default 35ca987d46SWarner Losh# selection. Since there are 18.2 ticks per second, the default value of 36ca987d46SWarner Losh# 0xb6 (182d) corresponds to 10 seconds. 37ca987d46SWarner LoshBOOT_BOOT0_TICKS?= 0xb6 38ca987d46SWarner Losh 39*bd5dc94bSJohn Baldwin# The BIOS loads boot0 to the hardcoded address 0x7c00. boot0 copies 40*bd5dc94bSJohn Baldwin# itself to this alternate base address before continuing execution so 41*bd5dc94bSJohn Baldwin# that next level boot blocks can be loaded at the 0x7c00 address they 42*bd5dc94bSJohn Baldwin# expect. Don't change this unless you are glutton for punishment 43*bd5dc94bSJohn Baldwin# (and fix ORIGIN in the source to match). 44ca987d46SWarner LoshBOOT_BOOT0_ORG?= 0x600 45ca987d46SWarner LoshORG=${BOOT_BOOT0_ORG} 46ca987d46SWarner Losh 47ca987d46SWarner Losh# Comm settings for boot0sio. 487ed32283SWarner Losh# 497ed32283SWarner Losh# boot0sio uses BIOS INT $0x14 for serial ports, we can only support these 507ed32283SWarner Losh# baudrates due to INT14's limited interface. In addition, if 517ed32283SWarner Losh# BOOT_BOOT0_COMCONSOLE_SPEED=0, then the baud rate and frame format will remain 527ed32283SWarner Losh# unchanged. Some BIOSes initialize the serial ports to 115200, and this may 537ed32283SWarner Losh# allow boot0sio access at that rate if so. 547ed32283SWarner Losh# 55ca987d46SWarner Losh# Bit(s) Description 56ca987d46SWarner Losh# 7-5 data rate (110,150,300,600,1200,2400,4800,9600 bps) 57ca987d46SWarner Losh# 4-3 parity (00 or 10 = none, 01 = odd, 11 = even) 58ca987d46SWarner Losh# 2 stop bits (set = 2, clear = 1) 59ca987d46SWarner Losh# 1-0 data bits (00 = 5, 01 = 6, 10 = 7, 11 = 8) 60ca987d46SWarner Losh.if !defined(BOOT_BOOT0_COMCONSOLE_SPEED) 61ca987d46SWarner LoshBOOT_COMCONSOLE_SPEED?= 9600 62ca987d46SWarner Losh.if ${BOOT_COMCONSOLE_SPEED} == 9600 63ca987d46SWarner LoshBOOT_BOOT0_COMCONSOLE_SPEED= "7 << 5 + 3" 64ca987d46SWarner Losh.elif ${BOOT_COMCONSOLE_SPEED} == 4800 65ca987d46SWarner LoshBOOT_BOOT0_COMCONSOLE_SPEED= "6 << 5 + 3" 66ca987d46SWarner Losh.elif ${BOOT_COMCONSOLE_SPEED} == 2400 67ca987d46SWarner LoshBOOT_BOOT0_COMCONSOLE_SPEED= "5 << 5 + 3" 68ca987d46SWarner Losh.elif ${BOOT_COMCONSOLE_SPEED} == 1200 69ca987d46SWarner LoshBOOT_BOOT0_COMCONSOLE_SPEED= "4 << 5 + 3" 70ca987d46SWarner Losh.elif ${BOOT_COMCONSOLE_SPEED} == 600 71ca987d46SWarner LoshBOOT_BOOT0_COMCONSOLE_SPEED= "3 << 5 + 3" 72ca987d46SWarner Losh.elif ${BOOT_COMCONSOLE_SPEED} == 300 73ca987d46SWarner LoshBOOT_BOOT0_COMCONSOLE_SPEED= "2 << 5 + 3" 74ca987d46SWarner Losh.elif ${BOOT_COMCONSOLE_SPEED} == 150 75ca987d46SWarner LoshBOOT_BOOT0_COMCONSOLE_SPEED= "1 << 5 + 3" 76ca987d46SWarner Losh.elif ${BOOT_COMCONSOLE_SPEED} == 110 77ca987d46SWarner LoshBOOT_BOOT0_COMCONSOLE_SPEED= "0 << 5 + 3" 78ca987d46SWarner Losh.else 79ca987d46SWarner LoshBOOT_BOOT0_COMCONSOLE_SPEED= "7 << 5 + 3" 80ca987d46SWarner Losh.endif 81ca987d46SWarner Losh.endif 82ca987d46SWarner Losh 83ca987d46SWarner LoshCFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \ 84ca987d46SWarner Losh -DTICKS=${BOOT_BOOT0_TICKS} \ 85ca987d46SWarner Losh -DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} 86ca987d46SWarner Losh 87ca987d46SWarner LoshLDFLAGS+=${LDFLAGS_BIN} 88ca987d46SWarner Losh 89ca987d46SWarner Losh.include <bsd.prog.mk> 90