head	1.32;
access;
symbols
	RELENG_8_4:1.32.0.2
	RELENG_9_1_0_RELEASE:1.30.2.1.4.2
	RELENG_9_1:1.30.2.1.0.4
	RELENG_9_1_BP:1.30.2.1
	RELENG_8_3_0_RELEASE:1.24.2.2.6.1
	RELENG_8_3:1.24.2.2.0.6
	RELENG_8_3_BP:1.24.2.2
	RELENG_9_0_0_RELEASE:1.30.2.1.2.1
	RELENG_9_0:1.30.2.1.0.2
	RELENG_9_0_BP:1.30.2.1
	RELENG_9:1.30.0.2
	RELENG_9_BP:1.30
	RELENG_7_4_0_RELEASE:1.23.10.1.4.1
	RELENG_8_2_0_RELEASE:1.24.2.2.4.1
	RELENG_7_4:1.23.10.1.0.4
	RELENG_7_4_BP:1.23.10.1
	RELENG_8_2:1.24.2.2.0.4
	RELENG_8_2_BP:1.24.2.2
	RELENG_8_1_0_RELEASE:1.24.2.2.2.1
	RELENG_8_1:1.24.2.2.0.2
	RELENG_8_1_BP:1.24.2.2
	RELENG_7_3_0_RELEASE:1.23.10.1.2.1
	RELENG_7_3:1.23.10.1.0.2
	RELENG_7_3_BP:1.23.10.1
	RELENG_8_0_0_RELEASE:1.24.2.1.2.1
	RELENG_8_0:1.24.2.1.0.2
	RELENG_8_0_BP:1.24.2.1
	RELENG_8:1.24.0.2
	RELENG_8_BP:1.24
	RELENG_7_2_0_RELEASE:1.23.20.1
	RELENG_7_2:1.23.0.20
	RELENG_7_2_BP:1.23
	RELENG_7_1_0_RELEASE:1.23.18.1
	RELENG_6_4_0_RELEASE:1.23.16.1
	RELENG_7_1:1.23.0.18
	RELENG_7_1_BP:1.23
	RELENG_6_4:1.23.0.16
	RELENG_6_4_BP:1.23
	RELENG_7_0_0_RELEASE:1.23
	RELENG_6_3_0_RELEASE:1.23
	RELENG_7_0:1.23.0.14
	RELENG_7_0_BP:1.23
	RELENG_6_3:1.23.0.12
	RELENG_6_3_BP:1.23
	RELENG_7:1.23.0.10
	RELENG_7_BP:1.23
	RELENG_6_2_0_RELEASE:1.23
	RELENG_6_2:1.23.0.8
	RELENG_6_2_BP:1.23
	RELENG_5_5_0_RELEASE:1.18.2.1
	RELENG_5_5:1.18.2.1.0.6
	RELENG_5_5_BP:1.18.2.1
	RELENG_6_1_0_RELEASE:1.23
	RELENG_6_1:1.23.0.6
	RELENG_6_1_BP:1.23
	RELENG_6_0_0_RELEASE:1.23
	RELENG_6_0:1.23.0.4
	RELENG_6_0_BP:1.23
	RELENG_6:1.23.0.2
	RELENG_6_BP:1.23
	RELENG_5_4_0_RELEASE:1.18.2.1
	RELENG_5_4:1.18.2.1.0.4
	RELENG_5_4_BP:1.18.2.1
	RELENG_4_11_0_RELEASE:1.4.2.2
	RELENG_4_11:1.4.2.2.0.10
	RELENG_4_11_BP:1.4.2.2
	RELENG_5_3_0_RELEASE:1.18.2.1
	RELENG_5_3:1.18.2.1.0.2
	RELENG_5_3_BP:1.18.2.1
	RELENG_5:1.18.0.2
	RELENG_5_BP:1.18
	RELENG_4_10_0_RELEASE:1.4.2.2
	RELENG_4_10:1.4.2.2.0.8
	RELENG_4_10_BP:1.4.2.2
	RELENG_5_2_1_RELEASE:1.15
	RELENG_5_2_0_RELEASE:1.15
	RELENG_5_2:1.15.0.4
	RELENG_5_2_BP:1.15
	RELENG_4_9_0_RELEASE:1.4.2.2
	RELENG_4_9:1.4.2.2.0.6
	RELENG_4_9_BP:1.4.2.2
	RELENG_5_1_0_RELEASE:1.15
	RELENG_5_1:1.15.0.2
	RELENG_5_1_BP:1.15
	RELENG_4_8_0_RELEASE:1.4.2.2
	RELENG_4_8:1.4.2.2.0.4
	RELENG_4_8_BP:1.4.2.2
	RELENG_5_0_0_RELEASE:1.13
	RELENG_5_0:1.13.0.2
	RELENG_5_0_BP:1.13
	RELENG_4_7_0_RELEASE:1.4.2.2
	RELENG_4_7:1.4.2.2.0.2
	RELENG_4_7_BP:1.4.2.2
	RELENG_4_6_2_RELEASE:1.4.2.1
	RELENG_4_6_1_RELEASE:1.4.2.1
	RELENG_4_6_0_RELEASE:1.4.2.1
	RELENG_4_6:1.4.2.1.0.4
	RELENG_4_6_BP:1.4.2.1
	RELENG_4_5_0_RELEASE:1.4.2.1
	RELENG_4_5:1.4.2.1.0.2
	RELENG_4_5_BP:1.4.2.1
	RELENG_4_4_0_RELEASE:1.4
	RELENG_4_4:1.4.0.6
	RELENG_4_4_BP:1.4
	KSE_MILESTONE_2:1.5
	KSE_PRE_MILESTONE_2:1.5
	RELENG_4_3_0_RELEASE:1.4
	RELENG_4_3:1.4.0.4
	RELENG_4_3_BP:1.4
	RELENG_4_2_0_RELEASE:1.4
	RELENG_4_1_1_RELEASE:1.4
	PRE_SMPNG:1.4
	RELENG_4_1_0_RELEASE:1.4
	RELENG_3_5_0_RELEASE:1.1.2.2
	RELENG_4_0_0_RELEASE:1.4
	RELENG_4:1.4.0.2
	RELENG_4_BP:1.4
	RELENG_3_4_0_RELEASE:1.1.2.2
	RELENG_3_3_0_RELEASE:1.1.2.2
	RELENG_3_2_PAO:1.1.2.1.0.2
	RELENG_3_2_PAO_BP:1.1.2.1
	RELENG_3_2_0_RELEASE:1.1.2.1
	POST_VFS_BIO_NFS_PATCH:1.2
	PRE_VFS_BIO_NFS_PATCH:1.2
	POST_SMP_VMSHARE:1.2
	PRE_SMP_VMSHARE:1.2
	POST_NEWBUS:1.1
	PRE_NEWBUS:1.1
	RELENG_3_1_0_RELEASE:1.1.2.1
	RELENG_3:1.1.0.2;
locks; strict;
comment	@# @;


1.32
date	2012.11.17.01.51.19;	author svnexp;	state Exp;
branches
	1.32.2.1;
next	1.31;

1.31
date	2012.11.07.19.51.53;	author dim;	state Exp;
branches;
next	1.30;

1.30
date	2011.04.05.13.48.53;	author nyan;	state Exp;
branches
	1.30.2.1;
next	1.29;

1.29
date	2011.01.05.21.46.08;	author dim;	state Exp;
branches;
next	1.28;

1.28
date	2010.09.21.21.41.45;	author dim;	state Exp;
branches;
next	1.27;

1.27
date	2010.08.31.17.38.20;	author dim;	state Exp;
branches;
next	1.26;

1.26
date	2009.12.31.15.03.33;	author nyan;	state Exp;
branches;
next	1.25;

1.25
date	2009.12.11.12.36.59;	author nyan;	state Exp;
branches;
next	1.24;

1.24
date	2008.06.26.07.56.16;	author ru;	state Exp;
branches
	1.24.2.1;
next	1.23;

1.23
date	2005.05.08.14.17.27;	author nyan;	state Exp;
branches
	1.23.2.1
	1.23.10.1
	1.23.16.1
	1.23.18.1
	1.23.20.1;
next	1.22;

1.22
date	2005.04.03.04.58.15;	author imp;	state Exp;
branches;
next	1.21;

1.21
date	2004.12.21.09.59.44;	author ru;	state Exp;
branches;
next	1.20;

1.20
date	2004.12.21.08.47.17;	author ru;	state Exp;
branches;
next	1.19;

1.19
date	2004.09.18.00.12.04;	author nyan;	state Exp;
branches;
next	1.18;

1.18
date	2004.02.09.16.01.45;	author nyan;	state Exp;
branches
	1.18.2.1;
next	1.17;

1.17
date	2004.02.07.14.35.32;	author ru;	state Exp;
branches;
next	1.16;

1.16
date	2004.02.07.12.19.43;	author nyan;	state Exp;
branches;
next	1.15;

1.15
date	2003.03.02.21.18.40;	author ru;	state Exp;
branches;
next	1.14;

1.14
date	2003.01.30.14.50.25;	author nyan;	state Exp;
branches;
next	1.13;

1.13
date	2002.10.10.14.03.00;	author nyan;	state Exp;
branches;
next	1.12;

1.12
date	2002.10.07.08.09.20;	author phk;	state Exp;
branches;
next	1.11;

1.11
date	2002.10.03.16.20.14;	author nyan;	state Exp;
branches;
next	1.10;

1.10
date	2002.07.29.09.40.15;	author ru;	state Exp;
branches;
next	1.9;

1.9
date	2002.05.26.10.11.17;	author n_hibma;	state Exp;
branches;
next	1.8;

1.8
date	2002.05.14.12.34.03;	author nyan;	state Exp;
branches;
next	1.7;

1.7
date	2002.05.10.09.26.32;	author obrien;	state Exp;
branches;
next	1.6;

1.6
date	2002.02.28.10.08.23;	author nyan;	state Exp;
branches;
next	1.5;

1.5
date	2001.05.24.11.18.32;	author nyan;	state Exp;
branches;
next	1.4;

1.4
date	99.11.16.11.56.38;	author nyan;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	99.08.28.00.40.22;	author peter;	state Exp;
branches;
next	1.2;

1.2
date	99.04.24.04.29.13;	author kato;	state Exp;
branches;
next	1.1;

1.1
date	99.02.03.08.39.08;	author kato;	state Exp;
branches
	1.1.2.1;
next	;

1.32.2.1
date	2012.11.17.01.51.19;	author svnexp;	state dead;
branches;
next	1.32.2.2;

1.32.2.2
date	2013.03.28.13.04.02;	author svnexp;	state Exp;
branches;
next	;

1.30.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.30.2.1.2.1
	1.30.2.1.4.1;
next	1.30.2.2;

1.30.2.2
date	2012.11.17.11.36.48;	author svnexp;	state Exp;
branches;
next	1.30.2.3;

1.30.2.3
date	2012.11.17.23.09.38;	author svnexp;	state Exp;
branches;
next	1.30.2.4;

1.30.2.4
date	2013.12.30.21.01.46;	author svnexp;	state Exp;
branches;
next	1.30.2.5;

1.30.2.5
date	2014.01.04.22.05.08;	author svnexp;	state Exp;
branches;
next	1.30.2.6;

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

1.30.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.30.2.1.2.2;

1.30.2.1.2.2
date	2012.11.17.08.36.46;	author svnexp;	state Exp;
branches;
next	;

1.30.2.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.30.2.1.4.2;

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

1.24.2.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.24.2.1.2.1;
next	1.24.2.2;

1.24.2.2
date	2010.01.15.12.27.46;	author nyan;	state Exp;
branches
	1.24.2.2.2.1
	1.24.2.2.4.1
	1.24.2.2.6.1;
next	1.24.2.3;

1.24.2.3
date	2012.11.17.10.36.27;	author svnexp;	state Exp;
branches;
next	1.24.2.4;

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

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

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

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

1.24.2.2.6.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.24.2.2.6.2;

1.24.2.2.6.2
date	2012.11.17.08.25.08;	author svnexp;	state Exp;
branches;
next	;

1.23.2.1
date	2010.01.15.12.52.45;	author nyan;	state Exp;
branches;
next	1.23.2.2;

1.23.2.2
date	2012.11.17.07.42.40;	author svnexp;	state Exp;
branches;
next	;

1.23.10.1
date	2010.01.15.12.45.23;	author nyan;	state Exp;
branches
	1.23.10.1.2.1
	1.23.10.1.4.1;
next	1.23.10.2;

1.23.10.2
date	2012.11.17.08.04.55;	author svnexp;	state Exp;
branches;
next	;

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

1.23.10.1.4.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.23.10.1.4.2;

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

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

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

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

1.18.2.1
date	2004.09.19.05.28.13;	author nyan;	state Exp;
branches;
next	;

1.4.2.1
date	2001.10.07.13.22.38;	author nyan;	state Exp;
branches;
next	1.4.2.2;

1.4.2.2
date	2002.08.07.16.31.53;	author ru;	state Exp;
branches;
next	1.4.2.3;

1.4.2.3
date	2012.11.17.07.25.22;	author svnexp;	state Exp;
branches;
next	;

1.1.2.1
date	99.02.06.07.37.11;	author kato;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	99.08.29.16.21.12;	author peter;	state Exp;
branches;
next	;


desc
@@


1.32
log
@Switching exporter and resync
@
text
@# $FreeBSD: head/sys/boot/pc98/boot2/Makefile 242706 2012-11-07 19:51:53Z dim $

.include <bsd.own.mk>

# XXX: clang can compile the boot code just fine, but boot2 gets too big
CC:=		gcc

FILES=		boot boot1 boot2

NM?=		nm

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

REL1=	0x700
ORG1=	0
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 \
	-D${BOOT2_UFS} \
	-DFLAGS=${BOOT_BOOT1_FLAGS} \
	-DSIOPRT=${BOOT_COMCONSOLE_PORT} \
	-DSIOFMT=${B2SIOFMT} \
	-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
	-I${.CURDIR}/../../.. \
	-I${.CURDIR}/../../i386/boot2 \
	-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

# Set machine type to PC98_SYSTEM_PARAMETER
#CFLAGS+=	-DSET_MACHINE_TYPE

# Initialize the bi_bios_geom using the BIOS geometry
#CFLAGS+=	-DGET_BIOSGEOM

LDFLAGS=-static -N --gc-sections

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

.PATH:	${.CURDIR}/../../i386/boot2

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=276 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 (read|putc)/ \
	    { x = $$1 - ORG1; \
	    printf("#define %sORG %#x\n", toupper($$3), REL1 + x) }' \
	    ORG1=`printf "%d" ${ORG1}` \
	    REL1=`printf "%d" ${REL1}` > ${.TARGET}

.include <bsd.prog.mk>
@


1.32.2.1
log
@file Makefile was added on branch RELENG_8_4 on 2013-03-28 13:04:02 +0000
@
text
@d1 109
@


1.32.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 104
# $FreeBSD: releng/8.4/sys/boot/pc98/boot2/Makefile 202352 2010-01-15 12:27:46Z nyan $

FILES=		boot boot1 boot2

NM?=		nm

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

REL1=	0x700
ORG1=	0
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 \
	-D${BOOT2_UFS} \
	-DFLAGS=${BOOT_BOOT1_FLAGS} \
	-DSIOPRT=${BOOT_COMCONSOLE_PORT} \
	-DSIOFMT=${B2SIOFMT} \
	-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
	-I${.CURDIR}/../../.. \
	-I${.CURDIR}/../../i386/boot2 \
	-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

# Set machine type to PC98_SYSTEM_PARAMETER
#CFLAGS+=	-DSET_MACHINE_TYPE

# Initialize the bi_bios_geom using the BIOS geometry
#CFLAGS+=	-DGET_BIOSGEOM

LDFLAGS=-static -N --gc-sections

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

.PATH:	${.CURDIR}/../../i386/boot2

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=276 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 (read|putc)/ \
	    { x = $$1 - ORG1; \
	    printf("#define %sORG %#x\n", toupper($$3), REL1 + x) }' \
	    ORG1=`printf "%d" ${ORG1}` \
	    REL1=`printf "%d" ${REL1}` > ${.TARGET}

.include <bsd.prog.mk>
@


1.31
log
@SVN rev 242706 on 2012-11-07 19:51:53Z by dim

Put in a band-aid to get the pc98 bootstraps building, now clang is the
default compiler.  This has two parts:
- Make sys/boot/pc98/boot2 always build with gcc for now, until we can
  figure out a way to shrink it enough when building with clang.
- Since sys/boot/p98/cdboot uses .code16 directives, which are not yet
  supported by clang's integrated assembler, use -no-integrated-as,
  similar to sys/boot/i386/cdboot.

Reviewed by:	nyan
MFC after:	1 week
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.30
log
@SVN rev 220361 on 2011-04-05 13:48:53Z by nyan

MFi386: revision 220337

  Build boot2 with -mregparm=3.
@
text
@d6 1
a6 1
CC:=${CC:C/^(.*\/)?clang$/gcc/1}
@


1.30.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.30.2.2
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/pc98/boot2/Makefile 220361 2011-04-05 13:48:53Z nyan $
@


1.30.2.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 243190
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r243190 | dim | 2012-11-17 22:40:18 +0000 (Sat, 17 Nov 2012) | 17 lines
## SVN ##
## SVN ## MFC r242706:
## SVN ##
## SVN ##   Put in a band-aid to get the pc98 bootstraps building, now clang is the
## SVN ##   default compiler.  This has two parts:
## SVN ##   - Make sys/boot/pc98/boot2 always build with gcc for now, until we can
## SVN ##     figure out a way to shrink it enough when building with clang.
## SVN ##   - Since sys/boot/p98/cdboot uses .code16 directives, which are not yet
## SVN ##     supported by clang's integrated assembler, use -no-integrated-as,
## SVN ##     similar to sys/boot/i386/cdboot.
## SVN ##
## SVN ##   Reviewed by:	nyan
## SVN ##
## SVN ## MFC r242874:
## SVN ##
## SVN ##   Work around pc98 tinderbox failures in sys/boot/pc98, by making sure a
## SVN ##   cross gcc gets built during the cross-tools stage.
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/sys/boot/pc98/boot2/Makefile 243190 2012-11-17 22:40:18Z dim $
d6 1
a6 1
CC:=		gcc
@


1.30.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/pc98/boot2/Makefile 260096 2013-12-30 20:15:46Z dim $
a6 1
COMPILER_TYPE:=	gcc
@


1.30.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/pc98/boot2/Makefile 260291 2014-01-04 22:00:07Z dim $
d53 1
a53 1
LD_FLAGS=-static -N --gc-sections
d71 1
a71 1
	${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
d92 1
a92 1
	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
@


1.30.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/pc98/boot2/Makefile 260497 2014-01-09 23:08:56Z dim $
d45 1
a45 3
	-Winline

CFLAGS.gcc+=	--param max-inline-insns-single=100
@


1.30.2.1.4.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.30.2.1.4.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.1/sys/boot/pc98/boot2/Makefile 220361 2011-04-05 13:48:53Z nyan $
@


1.30.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.30.2.1.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.0/sys/boot/pc98/boot2/Makefile 220361 2011-04-05 13:48:53Z nyan $
@


1.29
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
@d31 1
@


1.28
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
@a30 1
	-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \
@


1.27
log
@SVN rev 212062 on 2010-08-31 17:38:20Z by dim

Always compile pc98 boot2 with gcc instead of clang, just as with i386
boot2.  Unfortunately both still are too big when compiled with clang.

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


1.26
log
@SVN rev 201342 on 2009-12-31 15:03:33Z by nyan

Reimplement the boot2 for pc98 completely.
It's based on the newest i386's one and has the advantage of:

 - ELF binary support.
 - UFS2 filesystem support.
 - Many FreeBSD slices support on a disk.

Tested by:	SATOU Tomokazu ( tomo1770 _ maple _ ocn _ ne _ jp ),
		WATANABE Kazuhiro ( CQG00620 _ nifty _ ne _ jp ) and
		nyan

MFC after:	2 week

Happy New Year in Japan!!
@
text
@d3 7
@


1.25
log
@SVN rev 200407 on 2009-12-11 12:36:59Z by nyan

Cleanups the boot2 for pc98.  There is no functional change.
  - Make setting machine type and getting geom conditional for future.
  - Remove unused RAWBOOT and CDBOOT supports.
  - Remove unneeded include.
  - Fix warnings.

MFC after:	1 week
@
text
@a1 1
#
d3 37
a39 26
PROG=	boot
# Order is very important on the SRCS line for this prog
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

BINMODE=	444
CFLAGS=		-Os -mrtd \
		-fno-guess-branch-probability \
		-fno-unit-at-a-time \
		-D_KERNEL -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
CFLAGS+=	-DBOOTSEG=${BOOTSEG} -DBOOTSTACK=${BOOTSTACK}
CFLAGS+=	-I${.CURDIR}/../../.. -I.

# By default, if a serial port is going to be used as console, use COM1
# (aka /dev/ttyd0).
#BOOT_COMCONSOLE_PORT?=0x30
BOOT_COMCONSOLE_PORT?=0x238
BOOT_COMCONSOLE_CLK?=16
BOOT_COMCONSOLE_MODE=0x0c
CFLAGS+=	-DCOMCONSOLE=${BOOT_COMCONSOLE_PORT} \
		-DCOMCONSOLE_CLK=${BOOT_COMCONSOLE_CLK} \
		-DCOMCONSOLE_MODE=${BOOT_COMCONSOLE_MODE}

# feature not implemented
BOOT_COMCONSOLE_SPEED?=9600
CFLAGS+=	-DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
d42 1
a42 1
CFLAGS+=	-DSET_MACHINE_TYPE
d45 42
a86 1
CFLAGS+=	-DGET_BIOSGEOM
d88 1
a88 73
# Enable code to take the default boot string from a fixed location on the
# disk.  See nextboot(8) and README.386BSD for more info.
#CFLAGS+=	-DNAMEBLOCK
#CFLAGS+=	-DNAMEBLOCK_WRITEBACK

# Bias the conversion from the BIOS drive number to the FreeBSD unit number
# 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).
#CFLAGS+=	-DBOOT_HD_BIAS=1
#
# 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:da(0,a) instead of
# 1:wd(1,a).  If `da' is given explicitly, then the drive is assumed to be
# SCSI and have BIOS drive number (da_unit_number + BOOT_HD_BIAS).  E.g.,
# BOOT_HD_BIAS=1 makes da(0,a) correspond to 1:da(0,a) instead of 0:da(0,a).

CLEANFILES+=	boot.nohdr boot.strip boot.ldr boot1 boot2 sizetest
LDFLAGS+=	-N -Ttext 0 -e start
NO_SHARED=	YES
NO_MAN=
STRIP=

# tunable timeout parameter, waiting for keypress, calibrated in ms
BOOTWAIT?=	5000
# tunable timeout during string input, calibrated in ms
#TIMEOUT?=	30000

# Location that boot2 is loaded at
BOOTSEG=	0x1000

# Offset in BOOTSEG for the top of the stack, keep this 16 byte aligned
BOOTSTACK=	0xFFF0

boot.nohdr:	boot
	objcopy -S -O binary boot boot.nohdr
	ls -l boot.nohdr

boot.ldr:	boot.nohdr
	dd if=boot.nohdr of=boot.ldr bs=8192 count=1 conv=sync

boot1:		boot.nohdr
	dd if=boot.nohdr of=boot1 bs=512 count=1

boot2:		boot.nohdr
	dd if=boot.nohdr of=boot2 bs=512 skip=1
	@@dd if=boot2 skip=14 of=sizetest 2> /dev/null
	@@if [ -s sizetest ] ; then \
		echo "boot2 is too big" >&2 ; \
		rm boot2 ; \
		exit 2 ; \
	fi

all:		boot.ldr boot1 boot2

install:
	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
		boot.ldr ${DESTDIR}${BINDIR}/boot
	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
		boot1 boot2 ${DESTDIR}${BINDIR}

# If it's not there, don't consider it a target
.if exists(${.CURDIR}/../../../pc98/include)
beforedepend ${OBJS}: machine

machine:
	ln -sf ${.CURDIR}/../../../pc98/include machine

.endif

.if exists(${.CURDIR}/../../../i386/include) 
beforedepend ${OBJS}: i386
d90 1
a90 2
i386:
	ln -sf ${.CURDIR}/../../../i386/include i386
d92 4
a95 1
.endif
d97 6
a102 1
CLEANFILES+=	machine i386
a103 1
CWARNFLAGS!=	${MAKE} -f bsd.own.mk -f ${.CURDIR}/../../../conf/kern.mk -V CWARNFLAGS
@


1.24
log
@SVN rev 180023 on 2008-06-26 07:56:16Z by ru

Fix a fallout from SSP commit, and make this compile again.
Bonus: including kern.mk just to pick kernel warning flags
was an extremely bad idea anyway, because it also picked
up CFLAGS (it probably wasn't the case at the time of CVS
rev. 1.1, I haven't checked).  Remove duplicate CWARNFLAGS
from CFLAGS.
@
text
@d31 6
@


1.24.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.24.2.2
log
@SVN rev 202352 on 2010-01-15 12:27:46Z by nyan

MFC: revision 201342

  Reimplement the boot2 for pc98 completely.
  It's based on the newest i386's one and has the advantage of:

   - ELF binary support.
   - UFS2 filesystem support.
   - Many FreeBSD slices support on a disk.
@
text
@d2 1
d4 100
a103 1
FILES=		boot boot1 boot2
d105 2
a106 1
NM?=		nm
d108 1
a108 96
BOOT_COMCONSOLE_PORT?= 0x238
BOOT_COMCONSOLE_SPEED?= 9600
B2SIOFMT?=	0x3

REL1=	0x700
ORG1=	0
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 \
	-D${BOOT2_UFS} \
	-DFLAGS=${BOOT_BOOT1_FLAGS} \
	-DSIOPRT=${BOOT_COMCONSOLE_PORT} \
	-DSIOFMT=${B2SIOFMT} \
	-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
	-I${.CURDIR}/../../.. \
	-I${.CURDIR}/../../i386/boot2 \
	-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

# Set machine type to PC98_SYSTEM_PARAMETER
#CFLAGS+=	-DSET_MACHINE_TYPE

# Initialize the bi_bios_geom using the BIOS geometry
#CFLAGS+=	-DGET_BIOSGEOM

LDFLAGS=-static -N --gc-sections

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

.PATH:	${.CURDIR}/../../i386/boot2

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=276 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 (read|putc)/ \
	    { x = $$1 - ORG1; \
	    printf("#define %sORG %#x\n", toupper($$3), REL1 + x) }' \
	    ORG1=`printf "%d" ${ORG1}` \
	    REL1=`printf "%d" ${REL1}` > ${.TARGET}
d110 3
@


1.24.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/pc98/boot2/Makefile 202352 2010-01-15 12:27:46Z nyan $
@


1.24.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/pc98/boot2/Makefile 260291 2014-01-04 22:00:07Z dim $
d47 1
a47 1
LD_FLAGS=-static -N --gc-sections
d65 1
a65 1
	${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o
d86 1
a86 1
	${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
@


1.24.2.2.6.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.24.2.2.6.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/8.3/sys/boot/pc98/boot2/Makefile 202352 2010-01-15 12:27:46Z nyan $
@


1.24.2.2.4.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.24.2.2.2.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.24.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.23
log
@Remove ifdef PC98.
@
text
@a14 1
CFLAGS+=	${CWARNFLAGS}
d112 1
a112 1
.include "${.CURDIR}/../../../conf/kern.mk"
@


1.23.2.1
log
@SVN rev 202356 on 2010-01-15 12:52:45Z by nyan

MFC: revision 200407

  Cleanups the boot2 for pc98.  There is no functional change.
    - Make setting machine type and getting geom conditional for future.
    - Remove unused RAWBOOT and CDBOOT supports.
    - Remove unneeded include.
    - Fix warnings.

This change is directly merged into stable/6 because stable/[78] have
new boot2.
@
text
@a31 6
# Set machine type to PC98_SYSTEM_PARAMETER
CFLAGS+=	-DSET_MACHINE_TYPE

# Initialize the bi_bios_geom using the BIOS geometry
CFLAGS+=	-DGET_BIOSGEOM

@


1.23.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/6/sys/boot/pc98/boot2/Makefile 202356 2010-01-15 12:52:45Z nyan $
@


1.23.10.1
log
@SVN rev 202355 on 2010-01-15 12:45:23Z by nyan

MFC: revision 201342

  Reimplement the boot2 for pc98 completely.
  It's based on the newest i386's one and has the advantage of:

   - ELF binary support.
   - UFS2 filesystem support.
   - Many FreeBSD slices support on a disk.
@
text
@d2 1
d4 101
a104 1
FILES=		boot boot1 boot2
d106 2
a107 1
NM?=		nm
d109 1
a109 96
BOOT_COMCONSOLE_PORT?= 0x238
BOOT_COMCONSOLE_SPEED?= 9600
B2SIOFMT?=	0x3

REL1=	0x700
ORG1=	0
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 \
	-D${BOOT2_UFS} \
	-DFLAGS=${BOOT_BOOT1_FLAGS} \
	-DSIOPRT=${BOOT_COMCONSOLE_PORT} \
	-DSIOFMT=${B2SIOFMT} \
	-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
	-I${.CURDIR}/../../.. \
	-I${.CURDIR}/../../i386/boot2 \
	-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

# Set machine type to PC98_SYSTEM_PARAMETER
#CFLAGS+=	-DSET_MACHINE_TYPE

# Initialize the bi_bios_geom using the BIOS geometry
#CFLAGS+=	-DGET_BIOSGEOM

LDFLAGS=-static -N --gc-sections

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

.PATH:	${.CURDIR}/../../i386/boot2

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=276 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 (read|putc)/ \
	    { x = $$1 - ORG1; \
	    printf("#define %sORG %#x\n", toupper($$3), REL1 + x) }' \
	    ORG1=`printf "%d" ${ORG1}` \
	    REL1=`printf "%d" ${REL1}` > ${.TARGET}
d111 3
@


1.23.10.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/7/sys/boot/pc98/boot2/Makefile 202355 2010-01-15 12:45:23Z nyan $
@


1.23.10.1.4.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.23.10.1.4.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/7.4/sys/boot/pc98/boot2/Makefile 202355 2010-01-15 12:45:23Z nyan $
@


1.23.10.1.2.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.23.20.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.23.18.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.23.16.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.22
log
@Fix buidling of boot blocks for pc98 with new links.

Submitted by: nyan@@
@
text
@d13 1
a13 1
		-D_KERNEL -DPC98 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
@


1.21
log
@NOSHARED -> NO_SHARED
@
text
@d95 1
a95 1
.if exists(${.CURDIR}/../../../i386/include)
d99 1
a99 1
	ln -sf ${.CURDIR}/../../../i386/include machine
d103 9
a111 1
CLEANFILES+=	machine
@


1.20
log
@Start the dreaded NOFOO -> NO_FOO conversion.

OK'ed by:	core
@
text
@d52 1
a52 1
NOSHARED=	YES
@


1.19
log
@MFi386: revision 1.56 (Add -fno-unit-at-a-time to CFLAGS).
@
text
@d53 1
a53 1
NOMAN=
@


1.18
log
@MFi386: Factor out -nostdlib and use PROG.
@
text
@d12 1
@


1.18.2.1
log
@MFC: Add -fno-unit-at-a-time to CFLAGS.

Approved by:	re (scottl)
@
text
@a11 1
		-fno-unit-at-a-time \
@


1.17
log
@MFi386: Removed -elf and duplicate -ffreestanding.
@
text
@d50 1
a50 1
LDFLAGS+=	-N -Ttext 0 -nostdlib -e start
@


1.16
log
@MFi386: Cleanups to sys/boot makefiles.
@
text
@d10 2
a11 2
CFLAGS=		-elf -Os -mrtd \
		-ffreestanding -fno-builtin -fno-guess-branch-probability \
@


1.15
log
@Fixed sys/boot/pc98/boot2/Makefile to use kern.mk and
get rid of bsd.kern.mk completely.

OK'ed by:	bde
@
text
@a8 1
BINDIR=		/boot
@


1.14
log
@MFi386: Install the "boot" image which is boot1 + boot2.
@
text
@d105 1
a105 1
.include <bsd.kern.mk>
@


1.13
log
@Remove '-DUFS1_ONLY' from CFLAGS. It is not needed.
@
text
@d50 1
a50 1
CLEANFILES+=	boot.nohdr boot.strip boot1 boot2 sizetest
d71 3
d86 1
a86 1
all:		boot1 boot2
d89 2
@


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

Sponsored by:	DARPA & NAI Labs.
@
text
@a17 2
CFLAGS+=	-DUFS1_ONLY

@


1.11
log
@Added some header files from -stable and fixed the boot[12] programs.
@
text
@d18 1
@


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

Approved by:	bde
@
text
@d11 2
a12 1
CFLAGS=		-elf -Os -fno-guess-branch-probability -mrtd \
d16 1
a16 1
CFLAGS+=	-I${.CURDIR}/../../..
d89 11
@


1.9
log
@Cosmetic change (align with other boot blocks):

CONSPEED -> COMSPEED

Approved by:	nyan
@
text
@d86 1
a86 1
	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
@


1.8
log
@Fixed to build for GCC 3.1
@
text
@d30 1
a30 1
CFLAGS+=	-DCONSPEED=${BOOT_COMCONSOLE_SPEED}
@


1.7
log
@-ffreestanding is the word.
(also resort some CFLAGS such that the more "important" value are first so
they are easier to see)
@
text
@d11 1
a11 3
CFLAGS=		-elf -Os -ffreestanding -fforce-addr -fdata-sections \
		-malign-functions=0 -malign-jumps=0 -malign-loops=0 \
		-mpreferred-stack-boundary=2 -mrtd \
@


1.6
log
@Add -D_KERNEL to CFLAGS for ntohl().
@
text
@d11 1
a11 1
CFLAGS=		-elf -Os -fno-builtin -fforce-addr -fdata-sections \
@


1.5
log
@Update boot[12] program to compile ELF binary.

Submitted by:	Nobuyuki Koganemaru <n-kogane@@syd.odn.ne.jp> and
		kawanobe@@st.rim.or.jp (Kawanobe Koh)
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/pc98/boot2/Makefile,v 1.4 1999/11/16 11:56:38 nyan Exp $
d14 1
a14 1
		-DPC98 -DBOOTWAIT=${BOOTWAIT} -DTIMEOUT=${TIMEOUT}
@


1.4
log
@Remove -mno-486 option and add -mpreferred-stack-boundary=2 option.
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/pc98/boot2/Makefile,v 1.3 1999/08/28 00:40:22 peter Exp $
d11 2
a12 1
CFLAGS=		-Os -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
d17 1
a17 1
CFLAGS+=	-I${.CURDIR}/../../.. -aout
d53 1
a53 1
LDFLAGS+=	-N -T 0 -nostdlib
d69 2
a70 7
boot.strip:	boot
	cp -p boot boot.strip
	strip -aout boot.strip
	size -aout boot.strip

boot.nohdr:	boot.strip
	dd if=boot.strip of=boot.nohdr ibs=32 skip=1 obs=1024b
a89 1

@


1.4.2.1
log
@MFC: Update boot[12] programs to compile as ELF binary.
@
text
@d1 1
a1 1
# $FreeBSD: src/sys/boot/pc98/boot2/Makefile,v 1.4 1999/11/16 11:56:38 nyan Exp $
d11 1
a11 2
CFLAGS=		-elf -Os -fno-builtin -fforce-addr -fdata-sections \
		-malign-functions=0 -malign-jumps=0 -malign-loops=0 \
d16 1
a16 1
CFLAGS+=	-I${.CURDIR}/../../..
d52 1
a52 1
LDFLAGS+=	-N -Ttext 0 -nostdlib -e start
d68 7
a74 2
boot.nohdr:	boot
	objcopy -S -O binary boot boot.nohdr
d94 1
@


1.4.2.2
log
@MFC: Drop support for COPY.
@
text
@d1 1
a1 1
# $FreeBSD$
d88 1
a88 1
	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
@


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


1.3
log
@$Id$ -> $FreeBSD$
@
text
@d1 1
a1 1
# $FreeBSD$
d12 1
a12 1
		-mno-486 -mrtd \
@


1.2
log
@Optimize better for space.

Submitted by:	Takahashi Yoshihiro <nyan@@wyvern.cc.kogakuin.ac.jp>
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.1 1999/02/03 08:39:08 kato Exp $
@


1.1
log
@PC98 version of new boot loader.  Because boot2 has not yet ported,
files in boot2 directory are copies from legacy biosboot.

Submitted by:	IMAI Takeshi <take-i@@ceres.dti.ne.jp>
@
text
@d1 1
a1 1
#	$Id: Makefile,v 1.22 1999/01/04 08:02:13 kato Exp $
d11 2
a12 2
CFLAGS=		-O2 -malign-functions=0 -malign-jumps=0 -malign-loops=0 \
		-mno-486 \
@


1.1.2.1
log
@MFC: added boot loader for PC98.

Approved by:	jkh
@
text
@d1 1
a1 1
#	$Id$
@


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