head	1.15;
access;
symbols
	RELENG_3_5_0_RELEASE:1.11
	RELENG_3_4_0_RELEASE:1.11
	RELENG_3_3_0_RELEASE:1.11
	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.11
	PRE_NEWBUS:1.11
	RELENG_3_1_0_RELEASE:1.11
	RELENG_3:1.11.0.2
	RELENG_3_BP:1.11
	RELENG_3_0_0_RELEASE:1.5
	initial:1.1.1.1
	MSMITH:1.1.1;
locks; strict;
comment	@# @;


1.15
date	99.09.03.19.42.12;	author msmith;	state dead;
branches;
next	1.14;

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

1.13
date	99.06.29.21.23.08;	author peter;	state Exp;
branches;
next	1.12;

1.12
date	99.04.24.18.05.45;	author dcs;	state Exp;
branches;
next	1.11;

1.11
date	99.01.18.19.03.27;	author msmith;	state Exp;
branches;
next	1.10;

1.10
date	99.01.04.01.28.39;	author msmith;	state Exp;
branches;
next	1.9;

1.9
date	99.01.03.20.54.05;	author msmith;	state Exp;
branches;
next	1.8;

1.8
date	98.10.31.17.12.31;	author dfr;	state Exp;
branches;
next	1.7;

1.7
date	98.10.19.09.12.41;	author dfr;	state Exp;
branches;
next	1.6;

1.6
date	98.10.18.19.05.07;	author dfr;	state Exp;
branches;
next	1.5;

1.5
date	98.10.14.09.53.24;	author peter;	state Exp;
branches;
next	1.4;

1.4
date	98.10.07.02.33.01;	author msmith;	state Exp;
branches;
next	1.3;

1.3
date	98.09.26.10.51.36;	author dfr;	state Exp;
branches;
next	1.2;

1.2
date	98.08.22.10.31.00;	author dfr;	state Exp;
branches;
next	1.1;

1.1
date	98.08.21.03.17.42;	author msmith;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	98.08.21.03.17.42;	author msmith;	state Exp;
branches;
next	;


desc
@@


1.15
log
@Slight reorganisation of the Alpha/SRM loader build:

 - Make as much of the makefile for each of the three flavours
   (disk, CDROM, net) common.
 - Special-case the libalpha startup module on its use in boot1, not
   the other way around.
 - Build the loader out of a "loader" directory

Reviewed by:	mjacob, dfr
@
text
@#	$NetBSD: Makefile,v 1.12 1998/02/19 14:18:36 drochner Exp $

BASE= 		loader
PROG= 		${BASE}
NOMAN=
NEWVERSWHAT=	"SRM disk boot" alpha

.PATH:		${.CURDIR}/../common

# Alpha-specific bootstrap sources
SRCS+=		main.c conf.c

# Always add MI sources 
.PATH:		${.CURDIR}/../../common
.include	<${.CURDIR}/../../common/Makefile.inc>
CFLAGS+=	-mno-fp-regs
CFLAGS+=	-I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+=	-I${.CURDIR}/../../.. -I.
CFLAGS+=	-DLOADER
CFLAGS+=	-DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS} \
		-DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS}

CLEANFILES+=	vers.c vers.o gensetdefs.o gensetdefs setdef0.o setdef1.o \
		setdefs.h start.o
CLEANFILES+=	${BASE} ${BASE}.sym ${BASE}.list

CFLAGS+=	-Wall

CFLAGS+=	-I${LIBSTANDDIR}
CFLAGS+=	-I${.CURDIR}/..
CRT=		start.o
STRIP=
BINDIR?=	/boot

all: ${BASE}

vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
	sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
	${CC} -c vers.c

${BASE}: ${BASE}.sym ${BASE}.help
	objcopy -O binary ${BASE}.sym ${BASE}

${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBALPHA} ${CRT} vers.o setdef0.o setdef1.o
	${LD} -o ${BASE}.sym -M -e start -N -Ttext ${SECONDARY_LOAD_ADDRESS} \
	${CRT} setdef0.o ${OBJS} setdef1.o \
	vers.o ${LIBSTAND} ${LIBALPHA} ${LIBSTAND} >${.OBJDIR}/${BASE}.list

${BASE}.help: help.common help.alpha
	cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}

beforeinstall:
.if exists(${.OBJDIR}/loader.help)
	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
		${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
.else
	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
		${.CURDIR}/${BASE}.help ${DESTDIR}/boot
.endif

# Other fragments still to be brought in from ../Makfile.booters?
start.o:	${.CURDIR}/../libalpha/start.S
	${CC} -c ${CFLAGS} $<

setdef0.o: setdefs.h

setdef1.o: setdefs.h

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

CLEANFILES+=	machine

.include <bsd.prog.mk>

setdefs.h: gensetdefs ${OBJS}
	@@echo Generating linker sets
	@@./gensetdefs ${OBJS} >setdefs.h

gensetdefs: gensetdefs.o
	${CC} -static gensetdefs.o -o $@@

gensetdefs.o: gensetdefs.c
	${CC} -c $<

beforedepend ${OBJS}: machine
@


1.14
log
@Fix typo (wrong path)
@
text
@@


1.13
log
@Reconcile all the loader newvers.sh's into one common one.
@
text
@d37 1
a37 1
vers.o: ${.CURDIR}/../../newvers.sh ${.CURDIR}/version
@


1.12
log
@Minor nit. It is probably still incorrect, but at least don't
claim to use i386-specific files on alpha...
@
text
@d6 1
a6 1
NEWVERSWHAT=	"SRM disk boot"
d37 2
a38 2
vers.o: ${.CURDIR}/newvers.sh ${.CURDIR}/Makefile
	sh ${.CURDIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
@


1.11
log
@Transition from using Perl to using awk for our text-manipulation
needs.  This removes the dependancy on Perl for the generation of the
loader, allowing the world to be built on a perl-free system.

Submitted by:	Joe Abley <jabley@@clear.co.nz>
@
text
@d10 1
a10 1
# i386-specific bootstrap sources
@


1.10
log
@Add dependancy to build loader.help here
@
text
@d50 1
a50 1
	perl ${.CURDIR}/../../common/merge_help.pl ${.ALLSRC} > ${.TARGET}
@


1.9
log
@First cut at generating loader.help for the alpha
@
text
@d41 1
a41 1
${BASE}: ${BASE}.sym
@


1.8
log
@* Extend the memory available for the heap from 256k to 512k.
* Embed the stack into the bss section for loader and netboot.  This
  is required for netboot since otherwise the stack would be inside our
  heap.
* Install loader and netboot in /boot by default.
* Fix getbootfile so that it searches for a ',' instead of a ';'
  when terminating the filename.
@
text
@d49 12
@


1.7
log
@Reclaim the 48k used by the first bootstrap stage by adding it to the malloc
pool.
@
text
@d33 1
d51 1
a51 1
	${CC} -c $<
@


1.6
log
@Rename boot2 to loader.
@
text
@d19 3
@


1.5
log
@Initial attempt to update the Alpha loader and kernel to use the machine
independent elf loader and have access to kld modules.  Jordan and I were
not sure how to create boot floppies, and the things we tried just made
SRM laugh in our faces - but it was upset at boot1 which was not touched
by these changes.  Essentially this has been untested. :-(

What this does is to steal the last three slots from the nine spare longs
in the bootinfo_v1 struct to pass the module base pointer through.

The startup code now to set up and fills in the module and environment
structures, hopefully close enough to the i386 layout to be able to use
the same kernel code.  We now pass though the updated end of the kernel
space used, rather than _end. (like the i386).

If this does not work, it needs to be beaten into shape pronto.  Otherwise
it should be backed out before 3.0.

Pre-approved in principle by: dfr
@
text
@d3 1
a3 1
BASE= 		boot2
@


1.4
log
@VERBOSE_LS is obsolete
@
text
@d18 1
a18 1
CFLAGS+=	-I${.OBJDIR}
d53 5
d70 1
@


1.3
log
@* Add old UFS compatibility code to alpha/boot1.
* Fix a raft of warnings, printf and otherwise.
* Allocate the correct amount in mod_searchmodule to prevent an overflow.
* Fix the makefiles so they work outside my home directory (oops).
@
text
@a18 2
# Verbose ls causes extra heap usage
CFLAGS+=	-DVERBOSE_LS
@


1.2
log
@Minor tweaks to track a couple of i386 changes and to make it compile.
@
text
@d18 1
a27 3
# XXX fix to use "standard" versions
LIBSTANDDIR=	/home/dfr/FreeBSD/alpha/src/lib/libstand
LIBSTAND=	-lstand
a28 1
LIBALPHA=	${.OBJDIR}/../libalpha/libalpha.a
@


1.1
log
@Initial revision
@
text
@d29 1
a29 1
LIBSTAND=	${LIBSTANDDIR}/obj/libstand.a
d31 1
a31 1
LIBALPHA=	${.CURDIR}/../libalpha/obj/libalpha.a
@


1.1.1.1
log
@This is the new unified bootstrap, sometimes known previously as the
'three-stage' bootstrap.
There are a number of caveats with the code in its current state:
 - The i386 bootstrap only supports booting from a floppy.
 - The kernel and kld do not yet know how to deal with the extended
   information and module summary passed in.
 - PnP-based autodetection and demand loading of modules is not implemented.
 - i386 ELF kernel loading is not ready yet.
 - The i386 bootstrap is loaded via an ugly blockmap.

On the alpha, both net- and disk-booting (SRM console machines only) is
supported.  No blockmaps are used by this code.

Obtained from:	Parts from the NetBSD/i386 standalone bootstrap.
@
text
@@
