head	1.73;
access;
symbols
	RELENG_8_4:1.73.0.2
	RELENG_9_1_0_RELEASE:1.71.2.2.2.2
	RELENG_9_1:1.71.2.2.0.2
	RELENG_9_1_BP:1.71.2.2
	RELENG_8_3_0_RELEASE:1.61.2.2.2.1
	RELENG_8_3:1.61.2.2.0.2
	RELENG_8_3_BP:1.61.2.2
	RELENG_9_0_0_RELEASE:1.71.2.1.2.1
	RELENG_9_0:1.71.2.1.0.2
	RELENG_9_0_BP:1.71.2.1
	RELENG_9:1.71.0.2
	RELENG_9_BP:1.71
	RELENG_7_4_0_RELEASE:1.60.12.1
	RELENG_8_2_0_RELEASE:1.61.2.1.6.1
	RELENG_7_4:1.60.0.12
	RELENG_7_4_BP:1.60
	RELENG_8_2:1.61.2.1.0.6
	RELENG_8_2_BP:1.61.2.1
	RELENG_8_1_0_RELEASE:1.61.2.1.4.1
	RELENG_8_1:1.61.2.1.0.4
	RELENG_8_1_BP:1.61.2.1
	RELENG_7_3_0_RELEASE:1.60.10.1
	RELENG_7_3:1.60.0.10
	RELENG_7_3_BP:1.60
	RELENG_8_0_0_RELEASE:1.61.2.1.2.1
	RELENG_8_0:1.61.2.1.0.2
	RELENG_8_0_BP:1.61.2.1
	RELENG_8:1.61.0.2
	RELENG_8_BP:1.61
	RELENG_7_2_0_RELEASE:1.60.8.1
	RELENG_7_2:1.60.0.8
	RELENG_7_2_BP:1.60
	RELENG_7_1_0_RELEASE:1.60.6.1
	RELENG_6_4_0_RELEASE:1.58.12.1
	RELENG_7_1:1.60.0.6
	RELENG_7_1_BP:1.60
	RELENG_6_4:1.58.0.12
	RELENG_6_4_BP:1.58
	RELENG_7_0_0_RELEASE:1.60
	RELENG_6_3_0_RELEASE:1.58
	RELENG_7_0:1.60.0.4
	RELENG_7_0_BP:1.60
	RELENG_6_3:1.58.0.10
	RELENG_6_3_BP:1.58
	RELENG_7:1.60.0.2
	RELENG_7_BP:1.60
	RELENG_6_2_0_RELEASE:1.58
	RELENG_6_2:1.58.0.8
	RELENG_6_2_BP:1.58
	RELENG_5_5_0_RELEASE:1.56.2.2
	RELENG_5_5:1.56.2.2.0.4
	RELENG_5_5_BP:1.56.2.2
	RELENG_6_1_0_RELEASE:1.58
	RELENG_6_1:1.58.0.6
	RELENG_6_1_BP:1.58
	RELENG_6_0_0_RELEASE:1.58
	RELENG_6_0:1.58.0.4
	RELENG_6_0_BP:1.58
	RELENG_6:1.58.0.2
	RELENG_6_BP:1.58
	RELENG_5_4_0_RELEASE:1.56.2.2
	RELENG_5_4:1.56.2.2.0.2
	RELENG_5_4_BP:1.56.2.2
	RELENG_4_11_0_RELEASE:1.16.2.5
	RELENG_4_11:1.16.2.5.0.10
	RELENG_4_11_BP:1.16.2.5
	RELENG_5_3_0_RELEASE:1.56
	RELENG_5_3:1.56.0.4
	RELENG_5_3_BP:1.56
	RELENG_5:1.56.0.2
	RELENG_5_BP:1.56
	RELENG_4_10_0_RELEASE:1.16.2.5
	RELENG_4_10:1.16.2.5.0.8
	RELENG_4_10_BP:1.16.2.5
	RELENG_5_2_1_RELEASE:1.47
	RELENG_5_2_0_RELEASE:1.47
	RELENG_5_2:1.47.0.2
	RELENG_5_2_BP:1.47
	RELENG_4_9_0_RELEASE:1.16.2.5
	RELENG_4_9:1.16.2.5.0.6
	RELENG_4_9_BP:1.16.2.5
	RELENG_5_1_0_RELEASE:1.46
	RELENG_5_1:1.46.0.2
	RELENG_5_1_BP:1.46
	RELENG_4_8_0_RELEASE:1.16.2.5
	RELENG_4_8:1.16.2.5.0.4
	RELENG_4_8_BP:1.16.2.5
	RELENG_5_0_0_RELEASE:1.40.2.1
	RELENG_5_0:1.40.0.2
	RELENG_5_0_BP:1.40
	RELENG_4_7_0_RELEASE:1.16.2.5
	RELENG_4_7:1.16.2.5.0.2
	RELENG_4_7_BP:1.16.2.5
	RELENG_4_6_2_RELEASE:1.16.2.4
	RELENG_4_6_1_RELEASE:1.16.2.4
	RELENG_4_6_0_RELEASE:1.16.2.4
	RELENG_4_6:1.16.2.4.0.6
	RELENG_4_6_BP:1.16.2.4
	RELENG_4_5_0_RELEASE:1.16.2.4
	RELENG_4_5:1.16.2.4.0.4
	RELENG_4_5_BP:1.16.2.4
	RELENG_4_4_0_RELEASE:1.16.2.4
	RELENG_4_4:1.16.2.4.0.2
	RELENG_4_4_BP:1.16.2.4
	KSE_MILESTONE_2:1.22
	KSE_PRE_MILESTONE_2:1.22
	RELENG_4_3_0_RELEASE:1.16.2.3
	RELENG_4_3:1.16.2.3.0.2
	RELENG_4_3_BP:1.16.2.3
	RELENG_4_2_0_RELEASE:1.16.2.3
	RELENG_4_1_1_RELEASE:1.16.2.3
	PRE_SMPNG:1.19
	RELENG_4_1_0_RELEASE:1.16.2.3
	RELENG_3_5_0_RELEASE:1.11.2.2
	RELENG_4_0_0_RELEASE:1.16
	RELENG_4:1.16.0.2
	RELENG_4_BP:1.16
	RELENG_3_4_0_RELEASE:1.11.2.2
	RELENG_3_3_0_RELEASE:1.11.2.2
	RELENG_3_2_PAO:1.11.0.4
	RELENG_3_2_PAO_BP:1.11
	RELENG_3_2_0_RELEASE:1.11
	POST_VFS_BIO_NFS_PATCH:1.12
	PRE_VFS_BIO_NFS_PATCH:1.12
	POST_SMP_VMSHARE:1.12
	PRE_SMP_VMSHARE:1.12
	POST_NEWBUS:1.12
	PRE_NEWBUS:1.12
	RELENG_3_1_0_RELEASE:1.11
	RELENG_3:1.11.0.2
	RELENG_3_BP:1.11
	RELENG_3_0_0_RELEASE:1.7
	v1:1.1.1.1
	RNORDIER:1.1.1;
locks; strict;
comment	@# @;


1.73
date	2012.11.17.01.51.16;	author svnexp;	state Exp;
branches
	1.73.2.1;
next	1.72;

1.72
date	2012.02.28.18.30.18;	author dim;	state Exp;
branches;
next	1.71;

1.71
date	2011.07.17.13.50.21;	author dim;	state Exp;
branches
	1.71.2.1;
next	1.70;

1.70
date	2011.05.05.18.47.24;	author dim;	state Exp;
branches;
next	1.69;

1.69
date	2011.05.02.21.13.08;	author dim;	state Exp;
branches;
next	1.68;

1.68
date	2011.04.28.17.44.24;	author jhb;	state Exp;
branches;
next	1.67;

1.67
date	2011.04.04.18.23.55;	author rdivacky;	state Exp;
branches;
next	1.66;

1.66
date	2011.01.05.21.46.08;	author dim;	state Exp;
branches;
next	1.65;

1.65
date	2010.09.21.21.41.45;	author dim;	state Exp;
branches;
next	1.64;

1.64
date	2010.08.31.17.33.29;	author dim;	state Exp;
branches;
next	1.63;

1.63
date	2010.08.23.01.42.09;	author imp;	state Exp;
branches;
next	1.62;

1.62
date	2010.08.21.15.01.59;	author rpaulo;	state Exp;
branches;
next	1.61;

1.61
date	2009.03.07.22.05.58;	author marcel;	state Exp;
branches
	1.61.2.1;
next	1.60;

1.60
date	2007.05.19.05.07.47;	author kan;	state Exp;
branches
	1.60.2.1
	1.60.6.1
	1.60.8.1
	1.60.10.1
	1.60.12.1;
next	1.59;

1.59
date	2005.07.15.12.22.14;	author ache;	state Exp;
branches;
next	1.58;

1.58
date	2005.03.15.18.43.36;	author obrien;	state Exp;
branches
	1.58.2.1
	1.58.12.1;
next	1.57;

1.57
date	2004.08.27.15.01.56;	author yar;	state Exp;
branches;
next	1.56;

1.56
date	2004.07.30.04.27.20;	author kan;	state Exp;
branches
	1.56.2.1;
next	1.55;

1.55
date	2004.02.17.07.13.03;	author ru;	state Exp;
branches;
next	1.54;

1.54
date	2004.02.09.14.11.56;	author ru;	state Exp;
branches;
next	1.53;

1.53
date	2004.02.07.23.30.45;	author ru;	state Exp;
branches;
next	1.52;

1.52
date	2004.02.07.14.32.05;	author ru;	state Exp;
branches;
next	1.51;

1.51
date	2004.02.07.13.38.47;	author ru;	state Exp;
branches;
next	1.50;

1.50
date	2004.02.07.08.10.07;	author ru;	state Exp;
branches;
next	1.49;

1.49
date	2004.02.06.21.58.31;	author ru;	state Exp;
branches;
next	1.48;

1.48
date	2004.02.06.12.58.31;	author ru;	state Exp;
branches;
next	1.47;

1.47
date	2003.06.26.03.51.57;	author peter;	state Exp;
branches;
next	1.46;

1.46
date	2003.02.25.15.41.49;	author ru;	state Exp;
branches;
next	1.45;

1.45
date	2003.01.26.13.33.57;	author phk;	state Exp;
branches;
next	1.44;

1.44
date	2002.12.21.02.03.31;	author obrien;	state Exp;
branches;
next	1.43;

1.43
date	2002.12.18.07.13.53;	author imp;	state Exp;
branches;
next	1.42;

1.42
date	2002.12.17.21.10.34;	author imp;	state Exp;
branches;
next	1.41;

1.41
date	2002.12.14.19.44.13;	author phk;	state Exp;
branches;
next	1.40;

1.40
date	2002.10.08.18.19.01;	author jhb;	state Exp;
branches
	1.40.2.1;
next	1.39;

1.39
date	2002.10.08.15.49.35;	author phk;	state Exp;
branches;
next	1.38;

1.38
date	2002.10.08.12.09.16;	author green;	state Exp;
branches;
next	1.37;

1.37
date	2002.10.08.07.52.28;	author phk;	state Exp;
branches;
next	1.36;

1.36
date	2002.10.07.22.21.16;	author green;	state Exp;
branches;
next	1.35;

1.35
date	2002.10.07.21.36.06;	author phk;	state Exp;
branches;
next	1.34;

1.34
date	2002.10.07.20.56.08;	author phk;	state Exp;
branches;
next	1.33;

1.33
date	2002.10.07.08.09.20;	author phk;	state Exp;
branches;
next	1.32;

1.32
date	2002.07.29.09.40.14;	author ru;	state Exp;
branches;
next	1.31;

1.31
date	2002.06.21.11.00.00;	author phk;	state Exp;
branches;
next	1.30;

1.30
date	2002.06.21.06.18.01;	author mckusick;	state Exp;
branches;
next	1.29;

1.29
date	2002.06.05.12.30.41;	author phk;	state Exp;
branches;
next	1.28;

1.28
date	2002.06.05.11.10.38;	author phk;	state Exp;
branches;
next	1.27;

1.27
date	2002.05.13.16.16.00;	author ru;	state Exp;
branches;
next	1.26;

1.26
date	2002.05.12.15.45.28;	author bde;	state Exp;
branches;
next	1.25;

1.25
date	2002.05.11.21.39.59;	author peter;	state Exp;
branches;
next	1.24;

1.24
date	2002.05.10.04.05.42;	author jhb;	state Exp;
branches;
next	1.23;

1.23
date	2002.05.10.00.53.45;	author obrien;	state Exp;
branches;
next	1.22;

1.22
date	2001.07.31.19.50.09;	author jhb;	state Exp;
branches;
next	1.21;

1.21
date	2001.07.21.14.32.42;	author rnordier;	state Exp;
branches;
next	1.20;

1.20
date	2000.10.02.17.23.15;	author rnordier;	state Exp;
branches;
next	1.19;

1.19
date	2000.06.26.22.57.16;	author jhb;	state Exp;
branches;
next	1.18;

1.18
date	2000.05.23.12.18.48;	author jhb;	state Exp;
branches;
next	1.17;

1.17
date	2000.04.11.14.49.13;	author jhb;	state Exp;
branches;
next	1.16;

1.16
date	99.11.15.04.23.40;	author obrien;	state Exp;
branches
	1.16.2.1;
next	1.15;

1.15
date	99.11.13.23.08.46;	author obrien;	state Exp;
branches;
next	1.14;

1.14
date	99.08.28.00.40.00;	author peter;	state Exp;
branches;
next	1.13;

1.13
date	99.07.20.01.19.23;	author rnordier;	state Exp;
branches;
next	1.12;

1.12
date	99.04.05.07.24.51;	author rnordier;	state Exp;
branches;
next	1.11;

1.11
date	99.01.10.14.48.03;	author rnordier;	state Exp;
branches
	1.11.2.1;
next	1.10;

1.10
date	98.11.08.15.36.34;	author rnordier;	state Exp;
branches;
next	1.9;

1.9
date	98.11.05.20.52.25;	author rnordier;	state Exp;
branches;
next	1.8;

1.8
date	98.10.20.20.20.48;	author rnordier;	state Exp;
branches;
next	1.7;

1.7
date	98.10.15.22.08.13;	author rnordier;	state Exp;
branches;
next	1.6;

1.6
date	98.10.15.20.04.21;	author rnordier;	state Exp;
branches;
next	1.5;

1.5
date	98.10.14.01.53.56;	author rnordier;	state Exp;
branches;
next	1.4;

1.4
date	98.10.14.00.24.16;	author rnordier;	state Exp;
branches;
next	1.3;

1.3
date	98.10.13.21.35.42;	author rnordier;	state Exp;
branches;
next	1.2;

1.2
date	98.10.13.18.29.18;	author rnordier;	state Exp;
branches;
next	1.1;

1.1
date	98.10.12.21.16.26;	author rnordier;	state Exp;
branches
	1.1.1.1;
next	;

1.73.2.1
date	2012.11.17.01.51.16;	author svnexp;	state dead;
branches;
next	1.73.2.2;

1.73.2.2
date	2013.03.28.13.04.01;	author svnexp;	state Exp;
branches;
next	;

1.71.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.71.2.1.2.1;
next	1.71.2.2;

1.71.2.2
date	2012.03.13.18.39.57;	author dim;	state Exp;
branches
	1.71.2.2.2.1;
next	1.71.2.3;

1.71.2.3
date	2012.11.17.11.36.47;	author svnexp;	state Exp;
branches;
next	1.71.2.4;

1.71.2.4
date	2013.12.30.21.01.46;	author svnexp;	state Exp;
branches;
next	1.71.2.5;

1.71.2.5
date	2014.01.04.22.05.08;	author svnexp;	state Exp;
branches;
next	1.71.2.6;

1.71.2.6
date	2014.01.10.00.01.45;	author svnexp;	state Exp;
branches;
next	;

1.71.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.71.2.1.2.2;

1.71.2.1.2.2
date	2012.11.17.08.36.45;	author svnexp;	state Exp;
branches;
next	;

1.71.2.2.2.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.71.2.2.2.2;

1.71.2.2.2.2
date	2012.11.17.08.47.36;	author svnexp;	state Exp;
branches;
next	;

1.61.2.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.61.2.1.2.1
	1.61.2.1.4.1
	1.61.2.1.6.1;
next	1.61.2.2;

1.61.2.2
date	2011.06.06.09.36.46;	author mm;	state Exp;
branches
	1.61.2.2.2.1;
next	1.61.2.3;

1.61.2.3
date	2012.11.17.10.36.27;	author svnexp;	state Exp;
branches;
next	1.61.2.4;

1.61.2.4
date	2014.01.04.22.23.27;	author svnexp;	state Exp;
branches;
next	;

1.61.2.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.61.2.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.61.2.1.6.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.61.2.2.2.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.61.2.2.2.2;

1.61.2.2.2.2
date	2012.11.17.08.25.07;	author svnexp;	state Exp;
branches;
next	;

1.60.2.1
date	2012.11.17.08.04.52;	author svnexp;	state Exp;
branches;
next	;

1.60.6.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.60.8.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.60.10.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.60.12.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.60.12.2;

1.60.12.2
date	2012.11.17.08.17.05;	author svnexp;	state Exp;
branches;
next	;

1.58.2.1
date	2012.11.17.07.42.37;	author svnexp;	state Exp;
branches;
next	;

1.58.12.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;

1.56.2.1
date	2004.12.02.19.01.45;	author yar;	state Exp;
branches;
next	1.56.2.2;

1.56.2.2
date	2005.03.16.18.54.37;	author obrien;	state Exp;
branches;
next	;

1.40.2.1
date	2002.12.23.01.02.45;	author imp;	state Exp;
branches;
next	;

1.16.2.1
date	2000.04.15.03.09.40;	author ps;	state Exp;
branches;
next	1.16.2.2;

1.16.2.2
date	2000.07.06.23.04.28;	author obrien;	state Exp;
branches;
next	1.16.2.3;

1.16.2.3
date	2000.07.07.21.12.29;	author jhb;	state Exp;
branches;
next	1.16.2.4;

1.16.2.4
date	2001.08.14.22.55.29;	author jhb;	state Exp;
branches;
next	1.16.2.5;

1.16.2.5
date	2002.08.07.16.31.53;	author ru;	state Exp;
branches;
next	1.16.2.6;

1.16.2.6
date	2012.11.17.07.25.20;	author svnexp;	state Exp;
branches;
next	;

1.11.2.1
date	99.07.28.08.31.01;	author rnordier;	state Exp;
branches;
next	1.11.2.2;

1.11.2.2
date	99.08.29.16.20.43;	author peter;	state Exp;
branches;
next	;

1.1.1.1
date	98.10.12.21.16.26;	author rnordier;	state Exp;
branches;
next	;


desc
@@


1.73
log
@Switching exporter and resync
@
text
@# $FreeBSD: head/sys/boot/i386/boot2/Makefile 232263 2012-02-28 18:30:18Z dim $

.include <bsd.own.mk>

FILES=		boot boot1 boot2

NM?=		nm

# A value of 0x80 enables LBA support.
BOOT_BOOT1_FLAGS?=	0x80

BOOT_COMCONSOLE_PORT?= 0x3f8
BOOT_COMCONSOLE_SPEED?= 9600
B2SIOFMT?=	0x3

REL1=	0x700
ORG1=	0x7c00
ORG2=	0x2000

# Decide level of UFS support.
BOOT2_UFS?=	UFS1_AND_UFS2
#BOOT2_UFS?=	UFS2_ONLY
#BOOT2_UFS?=	UFS1_ONLY

CFLAGS=	-Os \
	-fno-guess-branch-probability \
	-fomit-frame-pointer \
	-fno-unit-at-a-time \
	-mno-align-long-strings \
	-mrtd \
	-mregparm=3 \
	-DUSE_XREAD \
	-D${BOOT2_UFS} \
	-DFLAGS=${BOOT_BOOT1_FLAGS} \
	-DSIOPRT=${BOOT_COMCONSOLE_PORT} \
	-DSIOFMT=${B2SIOFMT} \
	-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
	-I${.CURDIR}/../../common \
	-I${.CURDIR}/../btx/lib -I. \
	-Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
	-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
	-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
	-Winline --param max-inline-insns-single=100 \
	${CLANG_OPT_SMALL}

LDFLAGS=-static -N --gc-sections

# Pick up ../Makefile.inc early.
.include <bsd.init.mk>

CLEANFILES=	boot

boot: boot1 boot2
	cat boot1 boot2 > boot

CLEANFILES+=	boot1 boot1.out boot1.o

boot1: boot1.out
	objcopy -S -O binary boot1.out ${.TARGET}

boot1.out: boot1.o
	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o

CLEANFILES+=	boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \
		boot2.s boot2.s.tmp boot2.h sio.o

boot2: boot2.ld
	@@set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \
	    echo "$$x bytes available"; test $$x -ge 0
	dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync

boot2.ld: boot2.ldr boot2.bin ${BTXKERN}
	btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \
	    -o ${.TARGET} -P 1 boot2.bin

boot2.ldr:
	dd if=/dev/zero of=${.TARGET} bs=512 count=1

boot2.bin: boot2.out
	objcopy -S -O binary boot2.out ${.TARGET}

boot2.out: ${BTXCRT} boot2.o sio.o
	${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}

boot2.o: boot2.s
	${CC} ${ACFLAGS} -c boot2.s

SRCS=	boot2.c boot2.h

boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c
	${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c
	sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s
	rm -f boot2.s.tmp

boot2.h: boot1.out
	${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \
	    { x = $$1 - ORG1; \
	    printf("#define XREADORG %#x\n", REL1 + x) }' \
	    ORG1=`printf "%d" ${ORG1}` \
	    REL1=`printf "%d" ${REL1}` > ${.TARGET}

.if ${MACHINE_CPUARCH} == "amd64"
beforedepend boot2.s: machine
CLEANFILES+=	machine
machine:
	ln -sf ${.CURDIR}/../../../i386/include machine
.endif

.include <bsd.prog.mk>

# XXX: clang integrated-as doesn't grok .codeNN directives yet
CFLAGS.boot1.S=		${CLANG_NO_IAS}
CFLAGS+=		${CFLAGS.${.IMPSRC:T}}
@


1.73.2.1
log
@file Makefile was added on branch RELENG_8_4 on 2013-03-28 13:04:01 +0000
@
text
@d1 113
@


1.73.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 105
# $FreeBSD: releng/8.4/sys/boot/i386/boot2/Makefile 222741 2011-06-06 09:36:46Z mm $

FILES=		boot boot1 boot2

NM?=		nm

# A value of 0x80 enables LBA support.
BOOT_BOOT1_FLAGS?=	0x80

BOOT_COMCONSOLE_PORT?= 0x3f8
BOOT_COMCONSOLE_SPEED?= 9600
B2SIOFMT?=	0x3

REL1=	0x700
ORG1=	0x7c00
ORG2=	0x2000

# Decide level of UFS support.
BOOT2_UFS?=	UFS1_AND_UFS2
#BOOT2_UFS?=	UFS2_ONLY
#BOOT2_UFS?=	UFS1_ONLY

CFLAGS=	-Os \
	-fno-guess-branch-probability \
	-fomit-frame-pointer \
	-fno-unit-at-a-time \
	-mno-align-long-strings \
	-mrtd \
	-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \
	-DUSE_XREAD \
	-D${BOOT2_UFS} \
	-DFLAGS=${BOOT_BOOT1_FLAGS} \
	-DSIOPRT=${BOOT_COMCONSOLE_PORT} \
	-DSIOFMT=${B2SIOFMT} \
	-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
	-I${.CURDIR}/../../common \
	-I${.CURDIR}/../btx/lib -I. \
	-Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
	-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
	-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
	-Winline --param max-inline-insns-single=100

LDFLAGS=-static -N --gc-sections

# Pick up ../Makefile.inc early.
.include <bsd.init.mk>

CLEANFILES=	boot

boot: boot1 boot2
	cat boot1 boot2 > boot

CLEANFILES+=	boot1 boot1.out boot1.o

boot1: boot1.out
	objcopy -S -O binary boot1.out ${.TARGET}

boot1.out: boot1.o
	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o

CLEANFILES+=	boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \
		boot2.s boot2.s.tmp boot2.h sio.o

boot2: boot2.ld
	@@set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \
	    echo "$$x bytes available"; test $$x -ge 0
	dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync

boot2.ld: boot2.ldr boot2.bin ${BTXKERN}
	btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \
	    -o ${.TARGET} -P 1 boot2.bin

boot2.ldr:
	dd if=/dev/zero of=${.TARGET} bs=512 count=1

boot2.bin: boot2.out
	objcopy -S -O binary boot2.out ${.TARGET}

boot2.out: ${BTXCRT} boot2.o sio.o
	${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}

boot2.o: boot2.s

SRCS=	boot2.c boot2.h

boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c
	${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c
	sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s
	rm -f boot2.s.tmp

boot2.h: boot1.out
	${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \
	    { x = $$1 - ORG1; \
	    printf("#define XREADORG %#x\n", REL1 + x) }' \
	    ORG1=`printf "%d" ${ORG1}` \
	    REL1=`printf "%d" ${REL1}` > ${.TARGET}

.if ${MACHINE_ARCH} == "amd64"
beforedepend boot2.s: machine
CLEANFILES+=	machine
machine:
	ln -sf ${.CURDIR}/../../../i386/include machine
.endif

.include <bsd.prog.mk>
@


1.72
log
@SVN rev 232263 on 2012-02-28 18:30:18Z by dim

Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to
get rid of testing explicitly for clang (using ${CC:T:Mclang}) in
individual Makefiles.

Instead, use the following extra macros, for use with clang:
- NO_WERROR.clang       (disables -Werror)
- NO_WCAST_ALIGN.clang  (disables -Wcast-align)
- NO_WFORMAT.clang	(disables -Wformat and friends)
- CLANG_NO_IAS		(disables integrated assembler)
- CLANG_OPT_SMALL	(adds flags for extra small size optimizations)

As a side effect, this enables setting CC/CXX/CPP in src.conf instead of
make.conf!  For clang, use the following:

CC=clang
CXX=clang++
CPP=clang-cpp

MFC after:	2 weeks
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.71
log
@SVN rev 224131 on 2011-07-17 13:50:21Z by dim

When building some of the boot loaders with clang, and DEBUG_FLAGS or
CFLAGS having '-g' in it, clang outputs several assembly directives that
are too new for our version of binutils.

Therefore, assemble the resulting .s files with clang instead.  A more
general solution can be implemented when a GNU as-compatible driver for
clang's integrated assembler appears.

Reported by:	dougb
@
text
@d43 2
a44 8
	-Winline --param max-inline-insns-single=100

.if ${CC:T:Mclang} == "clang"
CFLAGS+=	-mllvm -stack-alignment=8 -mllvm -inline-threshold=3 \
		-mllvm -enable-load-pre=false
# XXX: clang integrated-as doesn't grok .codeNN directives yet
CFLAGS+=	${.IMPSRC:T:Mboot1.S:C/^.+$/-no-integrated-as/}
.endif
a85 1
.if ${CC:T:Mclang} == "clang"
a86 1
.endif
d110 4
@


1.71.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.71.2.2
log
@SVN rev 232930 on 2012-03-13 18:39:57Z by dim

MFC r232263:

Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to
get rid of testing explicitly for clang (using ${CC:T:Mclang}) in
individual Makefiles.

Instead, use the following extra macros, for use with clang:
- NO_WERROR.clang       (disables -Werror)
- NO_WCAST_ALIGN.clang  (disables -Wcast-align)
- NO_WFORMAT.clang	(disables -Wformat and friends)
- CLANG_NO_IAS		(disables integrated assembler)
- CLANG_OPT_SMALL	(adds flags for extra small size optimizations)

As a side effect, this enables setting CC/CXX/CPP in src.conf instead of
make.conf!  For clang, use the following:

CC=clang
CXX=clang++
CPP=clang-cpp
@
text
@d43 8
a50 2
	-Winline --param max-inline-insns-single=100 \
	${CLANG_OPT_SMALL}
d92 1
d94 1
a117 4

# XXX: clang integrated-as doesn't grok .codeNN directives yet
CFLAGS.boot1.S=		${CLANG_NO_IAS}
CFLAGS+=		${CFLAGS.${.IMPSRC:T}}
@


1.71.2.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/boot/i386/boot2/Makefile 232930 2012-03-13 18:39:57Z dim $
@


1.71.2.4
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/260096
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/boot/i386/boot2/Makefile 260096 2013-12-30 20:15:46Z dim $
d26 1
d28 2
a45 4
CFLAGS.gcc+=	-fno-guess-branch-probability \
		-fno-unit-at-a-time \
		-mno-align-long-strings \

@


1.71.2.5
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/260291
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/boot/i386/boot2/Makefile 260291 2014-01-04 22:00:07Z dim $
d47 1
a47 1
LD_FLAGS=-static -N --gc-sections
d63 1
a63 1
	${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
d84 1
a84 1
	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
@


1.71.2.6
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/260497
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/boot/i386/boot2/Makefile 260497 2014-01-09 23:08:56Z dim $
d40 1
a40 1
	-Winline \
a45 1
		--param max-inline-insns-single=100
@


1.71.2.2.2.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.71.2.2.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.1/sys/boot/i386/boot2/Makefile 232930 2012-03-13 18:39:57Z dim $
@


1.71.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.71.2.1.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.0/sys/boot/i386/boot2/Makefile 224131 2011-07-17 13:50:21Z dim $
@


1.70
log
@SVN rev 221506 on 2011-05-05 18:47:24Z by dim

Fine-tune llvm optimization for sys/boot/i386/boot2, which shaves off
some more bytes from the final boot2 image.

Submitted by:	rdivacky
@
text
@d92 3
@


1.69
log
@SVN rev 221348 on 2011-05-02 21:13:08Z by dim

Clang r130700 can now compile sys/boot/i386/boot2 with room to spare.
@
text
@d46 2
a47 1
CFLAGS+=	-mllvm -stack-alignment=8 -mllvm -inline-threshold=3
@


1.68
log
@SVN rev 221177 on 2011-04-28 17:44:24Z by jhb

Due to space constraints, the UFS boot2 and boot1 use an evil hack where
boot2 calls back into boot1 to perform disk reads.  The ZFS MBR boot blocks
do not have the same space constraints, so remove this hack for ZFS.
While here, remove commented out code to support C/H/S addressing from
zfsldr.  The ZFS and GPT bootstraps always just use EDD LBA addressing.

MFC after:	2 weeks
@
text
@a4 3
# XXX: clang can compile the boot code just fine, but boot2 gets too big
CC:=${CC:C/^(.*\/)?clang$/gcc/1}

d45 6
@


1.67
log
@SVN rev 220337 on 2011-04-04 18:23:55Z by rdivacky

Build boot2 with -mregparm=3, ie. pass upto 3 arguments via registers.
This modifies CFLAGS and tweaks sio.S to use the new calling convention.
The sio_init() and sio_putc() prototypes are modified so that other
users of this code know the correct calling convention.

This makes the code smaller when compiled with clang.

Reviewed by:    jhb
Tested by:      me and Freddie Cash <fjwcash gmail com>
@
text
@d35 1
@


1.66
log
@SVN rev 217028 on 2011-01-05 21:46:08Z by dim

Remove superfluous -mno-(mmx|3dnow|sse|sse2|sse3) flags in Makefiles
under sys/boot/{i386,pc98}, since these are already added via
sys/boot/{i386,pc98}/Makefile.inc.

Submitted by:	arundel
@
text
@d34 1
@


1.65
log
@SVN rev 212979 on 2010-09-21 21:41:45Z by dim

When building world with clang, for gnu/lib/libobjc, sys/boot/i386/boot2
and sys/boot/pc98/boot2, do not simply assign 'gcc' to CC, since compile
flags are sometimes passed via this variable, for example during the
build32 stage on amd64.  This caused the 32-bit libobjc build on amd64
to fail.

Instead, only replace the first instance of clang (if any, including
optional path) with gcc, and leave the arguments alone.

Approved-by:	rpaulo (mentor)
@
text
@a33 1
	-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \
@


1.64
log
@SVN rev 212060 on 2010-08-31 17:33:29Z by dim

Use a more robust way to substitute gcc for clang, when compiling
gnu/lib/libobjc and sys/boot/i386/boot2, so it also works when using
absolute paths and/or options, as in CC="/absolute/path/clang -foo".

Approved by:	rpaulo (mentor)
@
text
@d6 1
a6 3
.if ${CC:T:Mclang} == "clang"
CC=gcc
.endif
@


1.63
log
@SVN rev 211677 on 2010-08-23 01:42:09Z by imp

MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH
@
text
@d6 3
a8 1
CC:=${CC:C/^cc|^clang/gcc/}
@


1.62
log
@SVN rev 211571 on 2010-08-21 15:01:59Z by rpaulo

Make sure the boot2 stage is compiled with gcc, as clang has no
problems compiling it, but it just gets too big at the moment, even
with -Os.  This is not applicable to gptboot, though.

Submitted by:	Dimitry Andric <dimitry at andric.com>
@
text
@d102 1
a102 1
.if ${MACHINE_ARCH} == "amd64"
@


1.61
log
@SVN rev 189500 on 2009-03-07 22:05:58Z by marcel

Revert the part of change 107879 that employs the unused bytes after
the disklabel in the 2nd sector for boot code. Even with both UFS1
and UFS2 supported, there's enough bytes left that we don't have to
nibble from the disklabel.
Thus, the entire 2nd sector is now reserved for the disklabel, which
makes the bootcode compatible again with disklabels that have more
than 8 partitions -- such as those created and supported by gpart.

i386: 135 bytes available
amd64: 151 bytes available

Ok'd by: jhb
@
text
@d3 5
@


1.61.2.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.61.2.2
log
@SVN rev 222741 on 2011-06-06 09:36:46Z by mm

MFC ZFS version 28 and related revisions:
208682, 211900, 212543, 213791, 216378, 218007, 218725, 219089, 219090,
219092, 219316, 219317, 219320, 219404, 219636, 219703, 219959, 219973,
220447, 220575, 221112, 221177, 221263, 221409, 222050, 222267, 222268

MFC r208682 (pjd):
Fix panic when reading label from provider with non power of 2 sector size.

MFC r211900 (pjd):
Use ZFS_CTLDIR_NAME instead of hardcoding ".zfs".

MFC r212543 (imp):
Simplify atomic selection

MFC r213791 (rpaulo):
Pass a format string to panic() and to taskqueue_start_threads().

Found with:	clang

MFC r216378 (pjd):
Remove redundant semicolon and empty like.

MFC r218007 (jchandra):
CDDL fixes for MIPS n32.

Provide 64 bit atomic ops, and use 32 bit pointer.

MFC r218725 (dim):
When building libzpool on ia64 or sparc64, don't add the .note.GNU-stack
section.

MFC r219089 (pjd):
Finally... Import the latest open-source ZFS version - (SPA) 28.

Few new things available from now on:

- Data deduplication.
- Triple parity RAIDZ (RAIDZ3).
- zfs diff.
- zpool split.
- Snapshot holds.
- zpool import -F. Allows to rewind corrupted pool to earlier
  transaction group.
- Possibility to import pool in read-only mode.

MFC r219090 (pjd):
Commit two more files missed in r219089.

MFC r219092 (pjd):
Use proper lock in assertion.

MFC r219316 (pjd):
Simplify zvol_remove_minors() a bit.

MFC r219317 (pjd):
Make renaming of a ZVOL, ZVOL's parent directory and ZVOL snapshot work.

MFC r219320 (pjd):
Fix libzpool build.

MFC r219404 (pjd):
Correct readdir over ZFS handling.

MFC r219636 (pjd):
Fix potential panic in dbuf_sync_list() relate to spill blocks handling.

MFC r219703 (ae):
The size of zfsboot2 grown up to 64 Kbytes in r219089.
Increase NSECT up to 128 sectors too.

MFC r219959 (pjd):
Properly print characters larger than 127.

MFC r219973 (pjd):
Checking file access on size change is bogus. The checks are done earlier by
VFS where we know if this is truncate(2) or ftruncate(2). If this is the
latter we should depend on the mode the file was opened and not on the current
permission.

MFC r220447 (mm):
Partially fix ZFS compat code for sparc64.
Some endianess bugs still need to be resolved.

MFC r220575 (pjd):
Fix 'zfs list <path>' handling. If the path was found, the 'ret' variable was
uninitialized.

MFC r221112 (marcel):
Fix copy-paste bug.

MFC r221177 (jhb):
Due to space constraints, the UFS boot2 and boot1 use an evil hack where
boot2 calls back into boot1 to perform disk reads.  The ZFS MBR boot blocks
do not have the same space constraints, so remove this hack for ZFS.
While here, remove commented out code to support C/H/S addressing from
zfsldr.  The ZFS and GPT bootstraps always just use EDD LBA addressing.

MFC r221263 (mm):
Fix deduplicated zfs receive
(dmu_recv_stream builds incomplete guid_to_ds_map)

Illumos-gate changeset: 13329:c48b8bf84ab7

MFC r221409 (marius):
Convert the last use of xcopyout() to ddi_copyout() and remove the now
unused xcopyin() as well as xcopyout().

MFC r222050 (mm):
Restore old (v15) behaviour for a recursive snapshot destroy.
(zfs destroy -r pool/dataset@@snapshot)

To destroy all descendent snapshots with the same name the top level
snapshot was not required to exist. So if the top level snapshot does
not exist, check permissions of the parent dataset instead.

Filed as Illumos Bug #1043

MFC r222267 (pjd):
Don't access task structure once we call task function.
The task structure might be no longer available.
This also allows to eliminates the need for two tasks in the zio structure.

MFC r222268 (pjd):
Don't pass pointer to name buffer which is on the stack to another thread,
because the stack might be paged out once the other thread tries to use the
data. Instead, just allocate memory.

Discussed with:		pjd
@
text
@a29 1
	-DUSE_XREAD \
@


1.61.2.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/8/sys/boot/i386/boot2/Makefile 222741 2011-06-06 09:36:46Z mm $
@


1.61.2.4
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/260291
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: stable/8/sys/boot/i386/boot2/Makefile 260291 2014-01-04 22:00:07Z dim $
d43 1
a43 1
LD_FLAGS=-static -N --gc-sections
d59 1
a59 1
	${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
d80 1
a80 1
	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
@


1.61.2.2.2.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.61.2.2.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/8.3/sys/boot/i386/boot2/Makefile 222741 2011-06-06 09:36:46Z mm $
@


1.61.2.1.6.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.61.2.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.61.2.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.60
log
@Tweak inlining parameters a little. Add warning to tell us if function
we declared as inline can not be inlined.
@
text
@d73 1
a73 1
	dd if=/dev/zero of=${.TARGET} bs=276 count=1
@


1.60.2.1
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/7/sys/boot/i386/boot2/Makefile 169732 2007-05-19 05:07:47Z kan $
@


1.60.12.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.60.12.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/7.4/sys/boot/i386/boot2/Makefile 169732 2007-05-19 05:07:47Z kan $
@


1.60.10.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.60.8.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.60.6.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.59
log
@Add -mno-sse3 for prescott/nocona
@
text
@d39 2
a40 1
	-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings
@


1.58
log
@Ensure GCC does not use FP registers in integer code.
I think all we really need is -fno-sse2.
I really don't like cluttering up the compiler invocation,
but this bigger hammer will fix reported problems for now.
@
text
@d29 1
a29 1
	-mno-mmx -mno-3dnow -mno-sse -mno-sse2 \
@


1.58.2.1
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/6/sys/boot/i386/boot2/Makefile 143661 2005-03-15 18:43:36Z obrien $
@


1.58.12.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.57
log
@B1FLAGS -> BOOT_BOOT1_FLAGS, which is consistent with
naming of other boot-related make vars.
@
text
@d29 1
@


1.56
log
@Compile boot2 with -fno-unit-at-a-time. GCCs aggressive optimization
breaks boot in spectacular ways otherwise.
@
text
@d8 1
a8 1
B1FLAGS=	0x80
d30 1
a30 1
	-DFLAGS=${B1FLAGS} \
@


1.56.2.1
log
@MFC:	Try using packet mode by default, but provide a user
	with a knob to disable it at build time--flag 0x80 for
	BOOT_MBR_FLAGS and BOOT_BOOT1_FLAGS.  In fact, disabling
	packet mode completely, even a test for it, should be
	necessary only for old and brain-damaged machines FreeBSD 5
	will hardly run on.

	mbr/Makefile	1.14
	mbr/mbr.s	1.7
	boot2/Makefile	1.57
	boot2/boot1.S	1.30

Encouraged by:	Valentin Nechayev
@
text
@d8 1
a8 1
BOOT_BOOT1_FLAGS?=	0x80
d30 1
a30 1
	-DFLAGS=${BOOT_BOOT1_FLAGS} \
@


1.56.2.2
log
@Ensure GCC does not use FP registers in integer code.

Approved by:	re(ken)
@
text
@a28 1
	-mno-mmx -mno-3dnow -mno-sse -mno-sse2 \
@


1.55
log
@Re-add sio.S, and properly deal with assembler files.

Repocopied by:	joe
@
text
@d24 3
a26 1
	-fno-guess-branch-probability -fomit-frame-pointer\
@


1.54
log
@- Factor out -nostdlib to an upper level Makefile.inc.

- Now that bsd.prog.mk deals with programs linked with -nostdlib
  better, and has a notion of an "internal" program, use PROG
  where possible.  This has a good impact on the contents of
  .depend files and causes programs to be linked with cc(1).

XXX: boot2 couldn't be converted as it's actually two programs.

Tested on:	i386, amd64
@
text
@a22 5
AFLAGS+=--defsym FLAGS=${B1FLAGS} \
	--defsym SIOPRT=${BOOT_COMCONSOLE_PORT} \
	--defsym SIOFMT=${B2SIOFMT} \
	--defsym SIOSPD=${BOOT_COMCONSOLE_SPEED}

d28 4
a54 4

boot1.o: boot1.s
	${CPP} ${CFLAGS} ${.CURDIR}/boot1.s | \
	    ${AS} ${AFLAGS} -o ${.TARGET}
@


1.53
log
@Argh, unbreak "make depend" for AMD64.

Reported by:	kris
@
text
@d39 1
a39 1
LDFLAGS=-nostdlib -static -N --gc-sections
@


1.52
log
@- Removed -elf which is not a valid gcc(1) option anymore.
- Removed -ffreestanding; it's enforced by ../Makefile.inc.
@
text
@d99 1
a99 1
boot2.s: machine
@


1.51
log
@Generate .depend file.
@
text
@d28 1
a28 1
CFLAGS=	-elf -ffreestanding -Os -fno-builtin \
@


1.50
log
@Untangle building of AMD64 boot code.

Tested on:	amd64 (sledge)
@
text
@d84 2
@


1.49
log
@First round of cleanups to sys/boot/ makefiles:

- do not use PROG for what's not a real C program,
- use sys.mk transformation rules where possible,
- only create the "machine" symlink on AMD64,
- removed MAINTAINER lines in individual makefiles,
- added the LIBSTAND defitinion to <bsd.libnames.mk>,
- somewhat better contents in .depend files.

Tested on:	i386, amd64
Prodded by:	bde
@
text
@d96 1
a96 1
.if defined(REALLY_AMD64)
d98 1
a98 1

a100 2

CLEANFILES+=	machine
@


1.48
log
@Inherit BINDIR from a parent Makefile.inc.
@
text
@d3 1
a3 7
PROG=		boot2
NOMAN=
STRIP=
BINMODE=	444
CLEANFILES=	boot boot1 boot1.out boot1.o \
		boot2.ldr boot2.bin boot2.ld boot2.out boot2.o boot2.h \
		boot2.s sio.o
a13 6
.if exists(${.OBJDIR}/../btx)
BTX=	${.OBJDIR}/../btx
.else
BTX=	${.CURDIR}/../btx
.endif

d18 4
a21 1
# Decide Level of UFS support.  UFS1_AND_UFS2 doesn't fit.
d23 4
a26 3
# BOOT2_UFS?=	UFS2_ONLY
BOOT2_UFS?=	UFS1_AND_UFS2
# BOOT2_UFS?=	UFS1_ONLY
d41 4
a44 1
all: boot1 boot2 boot
d49 2
d58 2
a59 2
	${CPP} ${CFLAGS} ${.IMPSRC} | \
	    ${AS} ${AFLAGS} --defsym FLAGS=${B1FLAGS} -o ${.TARGET}
d61 2
a62 5
boot2.o: boot2.c ${.CURDIR}/../../common/ufsread.c
	${CC} ${CFLAGS} -S -o boot2.s.tmp ${.IMPSRC}
	sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s
	rm -f boot2.s.tmp
	${AS} ${AFLAGS} -o boot2.o boot2.s
d64 8
a71 13
boot2.h: boot1.out
	${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \
	 	{ x = $$1 - ORG1; \
		printf("#define XREADORG %#x\n", REL1 + x) }' \
	 	ORG1=`printf "%d" ${ORG1}` \
		REL1=`printf "%d" ${REL1}` > boot2.h

boot2: boot2.ldr boot2.bin ${BTX}/btx/btx
	btxld -v -E ${ORG2} -f bin -b ${BTX}/btx/btx -l boot2.ldr \
		-o boot2.ld -P 1 boot2.bin
	@@ls -l boot2.ld | awk '{ x = 7680 - $$5; \
		print x " bytes available"; if (x < 0) exit 1 }'
	dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync 2>/dev/null
d74 1
a74 1
	dd if=/dev/zero of=${.TARGET} bs=276 count=1 2>/dev/null
d79 2
a80 19
boot2.out: boot2.o sio.o
	${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} \
		${BTX}/lib/crt0.o ${.ALLSRC}

boot2.o: boot2.h

sio.o: sio.s
	${AS} ${AFLAGS} --defsym SIOPRT=${BOOT_COMCONSOLE_PORT} \
		--defsym SIOFMT=${B2SIOFMT} \
		--defsym SIOSPD=${BOOT_COMCONSOLE_SPEED} \
		${.IMPSRC} -o ${.TARGET}

install:
	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
		boot ${DESTDIR}${BINDIR}/boot
	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
		boot1 ${DESTDIR}${BINDIR}/boot1
	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
		boot2 ${DESTDIR}${BINDIR}/boot2
d82 13
a94 1
.include <bsd.prog.mk>
d97 1
a97 3
boot2.o: machine

beforedepend ${OBJS}: machine
d105 1
@


1.47
log
@Build on amd64.  Yes, I know this isn't particularly nice.
@
text
@a5 1
BINDIR?=	/boot
@


1.46
log
@Fixed CLEANFILES.

Submitted by:	cron
@
text
@d112 12
@


1.45
log
@Build a file "boot" which consists of boot1 and boot2 concatenated.

There is little if any reason to treat the two components separately
and it will simplify disklabel(8) and libdisk if we didn't.
@
text
@d8 1
a8 1
CLEANFILES+=	boot1 boot1.out boot1.o \
@


1.44
log
@-mno-align-long-strings can make things smaller, so lets use it in hopes
that it does here.
@
text
@d50 4
a53 1
all: boot1 boot2
d104 2
@


1.43
log
@I didn't intend to delete this rm from the Makefile.  It snuck in at
the last second before the commit.

# likely we can remove this hack now that gcc generates better aligned code
# in the align to word case.

Noticed by: bde
@
text
@d39 1
@


1.42
log
@Make both UFS1 and UFS2 fit on the same boot blocks.  These are a
subset of Peter's patchs that are believed to be safe.

Makefile tweaks:
o -fomit-frame-pointer
o Change default to building both UFS1 and UFS2 bootblocks.

Lots of boot2 tweaks:
o lookup is only ever called with kname, so use it directly.
o inline memsize
o getstr are only ever called with cmd, so hardware that.
o tweaks to the parsing code to test after the conversion rather than
  before since we tested after anyways.
o eliminate support for %x in printf.
o eliminate a few bytes in printfs.
o Tweak the boot banner.
o eliminate support for wd and "  " devices (I might add wd back to
  keep bde happy).
o eliminate support for a few arguments.

This takes us from -162 bytes free to 67 bytes free.

I've tested this only on a few systems, so be careful when updating to
this change.

Submitted by: peter, imp, ian
@
text
@d64 1
@


1.41
log
@Employ the unused bytes after the disklabel in the second sector.  This makes
it possible to make UFS1_ONLY and UFS2_ONLY versions which fit inside the
traditional 16 sectors.

Remove assorted now unneeded hackery.

UFS1_AND_UFS2 still needs another 150 bytes to work, and that is probably
not within our reach, ever.
@
text
@d34 2
a35 2
# BOOT2_UFS?=	UFS1_AND_UFS2
BOOT2_UFS?=	UFS1_ONLY
d38 1
a38 1
	-fno-guess-branch-probability \
d47 1
a47 1
LDFLAGS=-nostdlib -static -N
a63 1
	rm -f boot2.s.tmp
@


1.40
log
@Revert MEM_USR back to 0xa000 for BTX clients.  Instead, adjust boot2
to run at 0xc000 by changing its virtual start address from 0x1000 to
0x2000.

Tested by:	phk
@
text
@d31 4
a34 2
# Setting this to anything else gives UFS1+2 support and larger
# boot2 binary.
d40 1
a46 6
.if ${BOOT2_UFS} == "UFS1_ONLY"
CFLAGS+= -D${BOOT2_UFS}
.else
# nothing here
.endif

a76 1
.if ${BOOT2_UFS} == "UFS1_ONLY"
a79 5
.else
	@@ls -l boot2.ld | awk '{ x = 9728 - $$5; \
		print x " bytes available"; if (x < 0) exit 1 }'
	dd if=boot2.ld of=${.TARGET} obs=9728 conv=osync 2>/dev/null
.endif
d82 1
a82 1
	dd if=/dev/zero of=${.TARGET} bs=512 count=1 2>/dev/null
@


1.40.2.1
log
@MFC: All the changes to the boot blocks that allow UFS1 and UFS2 to
fit into 8k.

Requested by: re (scottl)
@
text
@d31 3
a33 5
# Decide Level of UFS support.  UFS1_AND_UFS2 doesn't fit.

# BOOT2_UFS?=	UFS2_ONLY
BOOT2_UFS?=	UFS1_AND_UFS2
# BOOT2_UFS?=	UFS1_ONLY
d36 1
a36 2
	-fno-guess-branch-probability -fomit-frame-pointer\
	-mno-align-long-strings \
a37 1
	-D${BOOT2_UFS} \
d44 7
a50 1
LDFLAGS=-nostdlib -static -N --gc-sections
d80 1
d84 5
d91 1
a91 1
	dd if=/dev/zero of=${.TARGET} bs=276 count=1 2>/dev/null
@


1.39
log
@Now that ufsread.c doesn't do 64bit divide remainder operations,
don't bother with libkern.

Sponsored by:	DARPA & NAI Labs.
@
text
@d29 1
a29 1
ORG2=	0x1000
@


1.38
log
@Reinstate rev 1.36 with an important line that got missed.  Note this
also improves the "random undocumented offsets into various memory
spaces" a little bit.
@
text
@d10 1
a10 1
		boot2.s sio.o divdi3.o moddi3.o qdivrem.o
d47 1
a47 1

a95 1
.if ${BOOT2_UFS} == "UFS1_ONLY"
a96 3
.else
boot2.out: boot2.o sio.o divdi3.o moddi3.o qdivrem.o
.endif
a106 9

moddi3.o: ${.CURDIR}/../../../libkern/moddi3.c
	${CC} ${CFLAGS} -I${.CURDIR}/../../../ -c ${.IMPSRC}

divdi3.o: ${.CURDIR}/../../../libkern/divdi3.c
	${CC} ${CFLAGS} -I${.CURDIR}/../../../ -c ${.IMPSRC}

qdivrem.o: ${.CURDIR}/../../../libkern/qdivrem.c
	${CC} ${CFLAGS} -I${.CURDIR}/../../../ -c ${.IMPSRC}
@


1.37
log
@Unbreak boot2 by backing out rev 1.36 to Makefile, which does not
work as advertised:

	bang# pwd
	/bang/src/sys/boot/i386/boot2
	bang# make clean >& /dev/null
	bang# cvs -q update -r 1.35 Makefile >& /dev/null
	bang# make >& /dev/null
	bang# cat /usr/obj/`pwd`/boot2.h
	#define XREADORG 0x725
	bang# cvs -q update -r 1.36 Makefile > & /dev/null
	bang# make clean > & /dev/null
	bang# make > & /dev/null
	bang# cat /usr/obj/`pwd`/boot2.h
	#define XREADORG 0x25
	bang#
@
text
@d27 1
d72 4
a75 2
	 	{ x = $$1 - ORG1; printf("#define XREADORG 0x7%x\n", x) }' \
	 	ORG1=`printf "%d" ${ORG1}` > boot2.h
@


1.36
log
@Correct a bug in adding 0x700 to a number.
@
text
@a26 1
REL1=	0x700
d71 1
a71 2
	 	{ x = $$1 - ORG1; \
		printf("#define XREADORG %#x\n", REL1 + x) }' \
@


1.35
log
@Conditionalize the number of sectors loaded by boot1.s on UFS1/UFS12.

Conditionalize the "XX bytes left" checks reference on UFS1/UFS12.

Conditionally build the necessary 64bit math for boot2 if UFS12.

Sponsored by:	DARPA & NAI Labs.
@
text
@d27 1
d72 2
a73 1
	 	{ x = $$1 - ORG1; printf("#define XREADORG 0x7%x\n", x) }' \
@


1.34
log
@Change the comment character from # to // in boot1.s and run
it through CPP so we can conditionalized things.

Sponsored by:	DARPA & NAI Labs
@
text
@d10 1
a10 1
		boot2.s sio.o
d30 4
d43 5
a47 1
CFLAGS+= -DUFS1_ONLY 
d77 1
d81 5
d93 1
d95 3
d99 1
a99 1
		${BTX}/lib/crt0.o boot2.o sio.o
d108 9
@


1.33
log
@Move the definition of UFS1_ONLY into the Makefiles where it belongs.

Sponsored by:	DARPA & NAI Labs.
@
text
@d52 2
a53 1
	${AS} ${AFLAGS} --defsym FLAGS=${B1FLAGS} ${.IMPSRC} -o ${.TARGET}
@


1.32
log
@Drop support for COPY, -c has been the default mode of install(1)
for a long time now.

Approved by:	bde
@
text
@d39 2
@


1.31
log
@Revert the part of Kirks UFS2 commit which added divdi3.c and moddi3.c
to libi386, this issue was resolved already in a cleaner way.
@
text
@d89 1
a89 1
	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
d91 1
a91 1
	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
@


1.30
log
@This commit adds basic support for the UFS2 filesystem. The UFS2
filesystem expands the inode to 256 bytes to make space for 64-bit
block pointers. It also adds a file-creation time field, an ability
to use jumbo blocks per inode to allow extent like pointer density,
and space for extended attributes (up to twice the filesystem block
size worth of attributes, e.g., on a 16K filesystem, there is space
for 32K of attributes). UFS2 fully supports and runs existing UFS1
filesystems. New filesystems built using newfs can be built in either
UFS1 or UFS2 format using the -O option. In this commit UFS1 is
the default format, so if you want to build UFS2 format filesystems,
you must specify -O 2. This default will be changed to UFS2 when
UFS2 proves itself to be stable. In this commit the boot code for
reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c)
as there is insufficient space in the boot block. Once the size of the
boot block is increased, this code can be defined.

Things to note: the definition of SBSIZE has changed to SBLOCKSIZE.
The header file <ufs/ufs/dinode.h> must be included before
<ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and
ufs_lbn_t.

Still TODO:
Verify that the first level bootstraps work for all the architectures.
Convert the utility ffsinfo to understand UFS2 and test growfs.
Add support for the extended attribute storage. Update soft updates
to ensure integrity of extended attribute storage. Switch the
current extended attribute interfaces to use the extended attribute
storage. Add the extent like functionality (framework is there,
but is currently never used).

Sponsored by: DARPA & NAI Labs.
Reviewed by:	Poul-Henning Kamp <phk@@freebsd.org>
@
text
@d78 1
a78 1
		${BTX}/lib/crt0.o boot2.o sio.o ../libi386/libi386.a
@


1.29
log
@Add explicit dependency on ufsread.c
@
text
@d78 1
a78 1
		${BTX}/lib/crt0.o boot2.o sio.o
@


1.28
log
@Preparation for UFS2 commit:

Factor the ufs reading code out of the i386/boot2 loader so it can
be reused by for instance sparc64.

Sponsored by: DARPA and NAI Labs.
@
text
@d52 1
a52 1
boot2.o: boot2.c
@


1.27
log
@Align CLEANFILES with revision 1.25 changes.
@
text
@d33 1
@


1.26
log
@Saved 176 bytes by compiling with -fno-guess-branch-probability.  The
default of -fguess-branch-probablility causes time optimizations (?)
like rewriting `if (foo) x++;' as
`if (!foo) goto forth; back: ; ...; forth: x++; goto back;".  This is
pessimizes space especially well on i386's because one short branch
gets converted to 2 long ones.

Removed -fno-align-foo since it is implied by -Os.  Previous commit
messages seem to have overstated the new alignment bugs in gcc.  The
only case that affects boot2 is that -fno-align-functions (or
equivalently -falign-functions=1) actually gives -falign-functions=2.
This is caused by FUNCTION_BOUNDARY being 2 (bytes) instead of 1.
The default case where the optimization level is 1 and no alignment
options are given is more broken.  All alignments are minimal, modulo
the bug in FUNCTION_BOUNDARY.  This is caused by toplev.c setting
defaults too early.

Some hacks in previous commits ar not needed now, but may as well be
kept until gcc is fixed.  The previous on in the Makefile saved 96
bytes of text due to the wrong FUNCTION_BOUNDARY and 32 bytes of data
due to unrelated bloat in the alignment of large objects.  There aren't
even any options to control alignment of data.
@
text
@d10 1
a10 1
		sio.o
@


1.25
log
@Use a crowbar and duct-tape to make boot2 fit again.  This gets it down
to 4 bytes free.  I removed a printf (the Keyboard yes/no) since it is of
marginal value and sed'ed the generated asm output to remove the unwanted
aligns.  There's probably a better way to gain a few extra bytes than
losing the printf.  Shortening strings is probably a better option but this
should get us over the hurdle.
@
text
@d31 1
a31 1
	-fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels \
@


1.24
log
@- Axe -mpreferred-stack-boundary=2 as -Os turns this on by default.
- Axe -fdata-sections as turning it on or off makes no difference.  If
  it did make a difference it would serve to bloat boot2 even further with
  extra padding.
- Axe -fforce-addr.  This gets us 32 bytes so we are down to only being
  64-bytes over.

We still can't compile this with gcc 3.1.  The problem seems to be that
the -fno-align-foo options don't actually work.  Comparing the new and
old output it turns out that gcc is 4-byte padding all the functions and
labels and what not despite the passed in arguments thus adding the
unfortunate bloat to boot2.
@
text
@d51 6
@


1.23
log
@-ffreestanding is the word for /sys.
@
text
@d30 1
a30 1
CFLAGS=	-elf -ffreestanding -Os -fno-builtin -fforce-addr -fdata-sections \
d32 1
a32 1
	-mrtd -mpreferred-stack-boundary=2 \
@


1.22
log
@Add in a hack to support IBM "El Torito" CD-ROM booting BIOS's which expect
the first sector of the emulated floppy to contain a valid MS-DOS BPB that
it can modify.  Since boot1 is the first sector of boot.flp, this resulted
in the BIOS overwriting part of boot1: specifically the function used to
read in sectors from the disk.

Submitted by:	Mark Peek <mark@@whistle.com>
Submitted by:	Doug Ambrisko <ambrisko@@ambrisko.com>
PR:		i386/26382
Obtained from:	NetBSD, OpenBSD (the example BPB)
MFC after:	1 month
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.21 2001/07/21 14:32:42 rnordier Exp $
d30 4
a33 4
CFLAGS=	-elf -I${.CURDIR}/../btx/lib -I. \
	-Os -fno-builtin -fforce-addr -fdata-sections \
	-malign-functions=0 -malign-jumps=0 -malign-loops=0 -mrtd \
	-mpreferred-stack-boundary=2 \
@


1.21
log
@Unset MAINTAINER.
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.20 2000/10/02 17:23:15 rnordier Exp $
d9 1
a9 1
		boot2.ldr boot2.bin boot2.ld boot2.out boot2.o \
d12 2
d51 5
d72 2
@


1.20
log
@Set MAINTAINER.
@
text
@d1 1
a1 3
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.19 2000/06/26 22:57:16 jhb Exp $

MAINTAINER=	rnordier
@


1.19
log
@Add in support for EDD to support large disks via LBA.  This uses a
method similar to that of the loader to avoid potentially breaking older
drives in that we only use EDD if the desired cylinder is > 1023.
@
text
@d1 3
a3 1
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.18 2000/05/23 12:18:48 jhb Exp $
@


1.18
log
@Clean up all of the 16-bit assembly code in the x86 bootstrap to work
with the new binutils.  Now that we have a decent assembler, all the old
m4 macros are no longer needed.  Instead, straight assembly can be used
since as(1) now understands 16-bit addressing, branches, etc.  Also,
several bugs have been fixed in as(1), allowing boot0.s to be further
cleaned up.
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.17 2000/04/11 14:49:13 jhb Exp $
d13 1
a13 1
B1FLAGS=	0
@


1.17
log
@Add a missing dependency: boot2 depends on the BTX kernel.
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.16 1999/11/15 04:23:40 obrien Exp $
a11 2
M4?=	m4

d46 2
a47 3
boot1.o: boot1.m4 boot1.s
	(cd ${.CURDIR}; ${M4} -DFLAGS=${B1FLAGS} boot1.m4 boot1.s) | \
		${AS} ${AFLAGS} -o ${.TARGET}
d67 4
a70 4
	(cd ${.CURDIR}; ${M4} -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
		-DSIOFMT=${B2SIOFMT} \
		-DSIOSPD=${BOOT_COMCONSOLE_SPEED} sio.s) | \
		${AS} ${AFLAGS} -o ${.TARGET}
@


1.16
log
@Add -fdata-sections, which is a new GCC 2.95 optimization.  Remove
-fschedule-insns as it wasn't such a big win with 2.95 after all.

Add the *BIG* win "-mpreferred-stack-boundary=2" optimiztion submitted by
Dima.  GCC 2.95 ensures the stack frame is always properly [opitimally]
aligned by surrounding every function call by code simular to
"addl $-12, %esp" / "addl $12, %esp".  Here we need the reduction in space,
with speed not an issue.
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.15 1999/11/13 23:08:46 obrien Exp $
d52 1
a52 1
boot2: boot2.ldr boot2.bin
@


1.16.2.1
log
@MFC: sync up loader with current, including PXE.
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.16 1999/11/15 04:23:40 obrien Exp $
d52 1
a52 1
boot2: boot2.ldr boot2.bin ${BTX}/btx/btx
@


1.16.2.2
log
@MFC:  clean up all of the 16-bit assembly code in the x86 bootstrap to work
      with Binutils 2.10.0 -- all the old m4 macros are no longer needed.

Also MFC rev 1.18-22 sys/boot/i386/btx/btx/btx.s (change string and support
                     new instructions).
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.16.2.1 2000/04/15 03:09:40 ps Exp $
d12 2
d48 3
a50 2
boot1.o: boot1.s
	${AS} ${AFLAGS} --defsym FLAGS=${B1FLAGS} ${.IMPSRC} -o ${.TARGET}
d70 4
a73 4
	${AS} ${AFLAGS} --defsym SIOPRT=${BOOT_COMCONSOLE_PORT} \
		--defsym SIOFMT=${B2SIOFMT} \
		--defsym SIOSPD=${BOOT_COMCONSOLE_SPEED} \
		${.IMPSRC} -o ${.TARGET}
@


1.16.2.3
log
@MFC: Lots of bootstrap fixes and features:

- Add $FreeBSD$ to README
- Coment fix for the if_wx module in loader.conf
- Axe all the unneeded m4 files (yay!)
- EDD support in mbr, boot1 and boot2, and the loader
- inline functions in boot2 that are only used once to gain 68 bytes of
  free space
- emulate the WBINVD instruction in BTX
- remove cruft from the cdldr Makefile
- improve hard disk probe checking as well as lsdev enhancements in the
  loader
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.16.2.2 2000/07/06 23:04:28 obrien Exp $
d13 1
a13 1
B1FLAGS=	0x80
@


1.16.2.4
log
@MFC: Hack to support CD booting on brain damaged IBM BIOSs.

Tested by:	users on -stable
Approved by:	re
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.16.2.3 2000/07/07 21:12:29 jhb Exp $
d9 1
a9 1
		boot2.ldr boot2.bin boot2.ld boot2.out boot2.o boot2.h \
a11 2
NM?=		nm

a48 5
boot2.h: boot1.out
	${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \
	 	{ x = $$1 - ORG1; printf("#define XREADORG 0x7%x\n", x) }' \
	 	ORG1=`printf "%d" ${ORG1}` > boot2.h

a64 2

boot2.o: boot2.h
@


1.16.2.5
log
@MFC: Drop support for COPY.
@
text
@d1 1
a1 1
# $FreeBSD$
d82 1
a82 1
	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
d84 1
a84 1
	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
@


1.16.2.6
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/4/sys/boot/i386/boot2/Makefile 101469 2002-08-07 16:32:02Z ru $
@


1.15
log
@Turn on the -fforce-addr and -fschedule-insns optimizations.  Adding
either one gives us an additional 32 bytes of additional space available
when using EGCS 1.1.2.  With GCC 2.95.2 -fforce-addr gives us 12 more bytes,
and adding -fschedule-insns gives us an additional 4 bytes.
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.14 1999/08/28 00:40:00 peter Exp $
d31 1
a31 1
	-Os -fno-builtin -fforce-addr -fschedule-insns \
d33 1
@


1.14
log
@$Id$ -> $FreeBSD$
@
text
@d1 1
a1 1
# $FreeBSD$
d30 3
a32 2
CFLAGS=	-elf -I${.CURDIR}/../btx/lib -I. -fno-builtin \
	-Os -malign-functions=0 -malign-jumps=0 -malign-loops=0 -mrtd \
@


1.13
log
@Reintroduce LBA (cyl > 1023) support in the bootblocks, enabled by
means of a build option.
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.12 1999/04/05 07:24:51 rnordier Exp $
@


1.12
log
@Optimize better for space.
Thanks to: jdp
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.11 1999/01/10 14:48:03 rnordier Exp $
d14 3
d47 1
a47 1
	(cd ${.CURDIR}; ${M4} boot1.m4 boot1.s) | \
@


1.11
log
@Use etc/make.conf settings for serial port and speed.

Submitted by: rvb
Reviewed by: bde
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.10 1998/11/08 15:36:34 rnordier Exp $
d28 1
a28 1
	-O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 -mrtd \
@


1.11.2.1
log
@MFC: LBA access as build option.
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.11 1999/01/10 14:48:03 rnordier Exp $
a13 3
# A value of 0x80 enables LBA support.
B1FLAGS=	0

d44 1
a44 1
	(cd ${.CURDIR}; ${M4} -DFLAGS=${B1FLAGS} boot1.m4 boot1.s) | \
@


1.11.2.2
log
@$Id$ -> $FreeBSD$
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.10
log
@boot1: Eliminate EDD detection and optional use of disk packet
interface.  Do some general consistency fixes and space optimizations.
Use of some freed-up space to defend against possible BIOS misfeatures.

boot2: Revise disk read interface to provide for boot1 changes.  Free
up space for this.
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.9 1998/11/05 20:52:25 rnordier Exp $
d14 2
a15 1
B2SIOPRT?=	0x3f8
a16 1
B2SIODIV?=	0xc
d65 3
a67 2
	(cd ${.CURDIR}; ${M4} -DSIOPRT=${B2SIOPRT} \
		-DSIOFMT=${B2SIOFMT} -DSIODIV=${B2SIODIV} sio.s) | \
@


1.9
log
@Make use of BIOS int 0x13 extensions configurable, and disabled
by default.
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.8 1998/10/20 20:20:48 rnordier Exp $
a13 1
B1INT13X?=	0
d44 1
a44 1
	(cd ${.CURDIR}; ${M4} -DFLAGS=${B1INT13X} boot1.m4 boot1.s) | \
@


1.8
log
@Make serial port, data format, and bps configurable.
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.7 1998/10/15 22:08:13 rnordier Exp $
d14 1
d45 1
a45 1
	(cd ${.CURDIR}; ${M4} boot1.m4 boot1.s) | \
@


1.7
log
@Fix path to sio.s
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.6 1998/10/15 20:04:21 rnordier Exp $
d14 4
d65 3
a67 1
	${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
@


1.6
log
@Add serial, dual, and probe-keyboard support.
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.5 1998/10/14 01:53:56 rnordier Exp $
d61 1
a61 1
	${AS} ${AFLAGS} -o ${.TARGET} sio.s
@


1.5
log
@Fix btx include path.
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.4 1998/10/14 00:24:16 rnordier Exp $
d9 2
a10 1
		boot2.ldr boot2.bin boot2.ld boot2.out boot2.o
d56 1
a56 1
boot2.out: boot2.o
d58 4
a61 1
		${BTX}/lib/crt0.o boot2.o
@


1.4
log
@Include <bsd.prog.mk>.  Add install target (to /boot for now).
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.3 1998/10/13 21:35:42 rnordier Exp $
d22 1
a22 1
CFLAGS=	-elf -I${BTX}/lib -I. -fno-builtin \
@


1.3
log
@Change to a 15-sector boot2.
Refine slice-handling.
@
text
@d1 9
a9 1
#	$Id: Makefile,v 1.2 1998/10/13 18:29:18 rnordier Exp $
d39 2
a40 1
	${M4} boot1.m4 boot1.s | ${AS} ${AFLAGS} -o ${.TARGET}
d59 7
a65 3
clean:
	rm -f boot1 boot1.out boot1.o boot2 boot2.ldr boot2.bin \
		boot2.ld boot2.out boot2.o
@


1.2
log
@Don't use an absolute path to objcopy.
Noticed by: Scott Mace <smace@@intt.org>
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.1.1.1 1998/10/12 21:16:26 rnordier Exp $
d35 4
a38 3
		-o ${.TARGET} -P 1 boot2.bin
	@@ls -l boot2 | awk '{ x = 7680 - $$5; print x " bytes free"; \
		if (x < 0) exit 1 }'
d52 1
a52 1
		boot2.out boot2.o
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
#	$Id:$
d25 1
a25 1
	/usr/libexec/elf/objcopy -S -O binary boot1.out ${.TARGET}
d43 1
a43 1
	/usr/libexec/elf/objcopy -S -O binary boot2.out ${.TARGET}
@


1.1.1.1
log
@New boot blocks: support for /boot/loader; a.out & ELF; cyl > 1023;
multiple 0xa5 slices; etc.
@
text
@@
