summaryrefslogtreecommitdiff
path: root/sys/boot/alpha
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/alpha')
-rw-r--r--sys/boot/alpha/Makefile.inc8
-rw-r--r--sys/boot/alpha/boot1/Makefile10
-rw-r--r--sys/boot/alpha/boot1/boot1.c4
-rw-r--r--sys/boot/alpha/boot2/Makefile22
-rw-r--r--sys/boot/alpha/boot2/help.alpha0
-rw-r--r--sys/boot/alpha/boot2/newvers.sh1
-rw-r--r--sys/boot/alpha/common/main.c76
-rw-r--r--sys/boot/alpha/libalpha/Makefile4
-rw-r--r--sys/boot/alpha/libalpha/srmdisk.c41
-rw-r--r--sys/boot/alpha/libalpha/start.S15
-rw-r--r--sys/boot/alpha/netboot/Makefile6
11 files changed, 44 insertions, 143 deletions
diff --git a/sys/boot/alpha/Makefile.inc b/sys/boot/alpha/Makefile.inc
index abb4f65cbc89..bbbea75f1efe 100644
--- a/sys/boot/alpha/Makefile.inc
+++ b/sys/boot/alpha/Makefile.inc
@@ -1,8 +1,10 @@
# Options used when building app-specific libalpha components
-PRIMARY_LOAD_ADDRESS= 0x20000000 # "Region 1 start"
-SECONDARY_LOAD_ADDRESS= 0x2000c000 # "Region 1 start" + 48k
-HEAP_LIMIT= 0x20040000 # "Region 1 start" + 256k
+PRIMARY_LOAD_ADDRESS= 20000000 # "Region 1 start"
+SECONDARY_LOAD_ADDRESS= 2000c000 # "Region 1 start" + 48k
+HEAP_LIMIT= 20040000 # "Region 1 start" + 256k
DPADD+= ${DESTDIR}/${LIBDIR}/libstand.a
LIBSTANDDIR= ${.CURDIR}/../../../../lib/libstand
LIBSTAND= -lstand
LIBALPHA= ${.OBJDIR}/../libalpha/libalpha.a
+
+BINDIR= /usr/mdec
diff --git a/sys/boot/alpha/boot1/Makefile b/sys/boot/alpha/boot1/Makefile
index bfbcb7a88114..e163c03345a4 100644
--- a/sys/boot/alpha/boot1/Makefile
+++ b/sys/boot/alpha/boot1/Makefile
@@ -12,10 +12,9 @@ CFLAGS+= -mno-fp-regs
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${LIBSTANDDIR}
CFLAGS+= -I${.CURDIR}/..
-CFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS} -DMINIMAL
+CFLAGS+= -DSECONDARY_LOAD_ADDRESS=0x${SECONDARY_LOAD_ADDRESS} -DMINIMAL
NOMAN=1
STRIP=
-BINDIR?= /boot
BOOT_RELOC = ${PRIMARY_LOAD_ADDRESS}
@@ -23,6 +22,10 @@ CLEANFILES+= ${PROG}.sym ${PROG}.nosym ${PROG}.list
all: ${PROG}
+afterinstall:
+ ln -sf boot1 /usr/mdec/daboot
+ ln -sf boot1 /usr/mdec/fdboot
+
${PROG}.nosym: ${PROG}.sym
cp ${PROG}.sym ${PROG}.nosym
strip ${PROG}.nosym
@@ -33,9 +36,10 @@ ${PROG}: ${PROG}.nosym
.include <bsd.prog.mk>
start.o: ${.CURDIR}/../libalpha/start.S
- ${CC} -c ${CFLAGS} $<
+ ${CC} -c -DPRIMARY_BOOTBLOCK $<
${PROG}.sym: ${OBJS} ${LIBKERN}
${LD} -M -Ttext ${BOOT_RELOC} -N -e start -o ${PROG}.sym ${OBJS} \
${LIBSTAND} ${LIBALPHA} ${LIBSTAND} > ${.OBJDIR}/${PROG}.list
size ${PROG}.sym
+
diff --git a/sys/boot/alpha/boot1/boot1.c b/sys/boot/alpha/boot1/boot1.c
index 9eac7ec64c71..a3fbfc2bf397 100644
--- a/sys/boot/alpha/boot1/boot1.c
+++ b/sys/boot/alpha/boot1/boot1.c
@@ -1,5 +1,5 @@
/*
- * $Id: boot1.c,v 1.2 1998/09/26 10:51:36 dfr Exp $
+ * $Id: boot1.c,v 1.1.1.1 1998/08/21 03:17:41 msmith Exp $
* From $NetBSD: bootxx.c,v 1.4 1997/09/06 14:08:29 drochner Exp $
*/
@@ -181,7 +181,7 @@ main()
init_prom_calls();
- loadfile("/boot/loader", loadaddr);
+ loadfile("/boot/boot2", loadaddr);
entry = (void (*)())loadaddr;
(*entry)();
diff --git a/sys/boot/alpha/boot2/Makefile b/sys/boot/alpha/boot2/Makefile
index 956944d255c8..dfc8e58121eb 100644
--- a/sys/boot/alpha/boot2/Makefile
+++ b/sys/boot/alpha/boot2/Makefile
@@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.12 1998/02/19 14:18:36 drochner Exp $
-BASE= loader
+BASE= boot2
PROG= ${BASE}
NOMAN=
NEWVERSWHAT= "SRM disk boot"
@@ -16,9 +16,6 @@ SRCS+= main.c conf.c
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
@@ -30,7 +27,6 @@ CFLAGS+= -I${LIBSTANDDIR}
CFLAGS+= -I${.CURDIR}/..
CRT= start.o
STRIP=
-BINDIR?= /boot
all: ${BASE}
@@ -38,7 +34,7 @@ vers.o: ${.CURDIR}/newvers.sh ${.CURDIR}/Makefile
sh ${.CURDIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
-${BASE}: ${BASE}.sym ${BASE}.help
+${BASE}: ${BASE}.sym
objcopy -O binary ${BASE}.sym ${BASE}
${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBALPHA} ${CRT} vers.o setdef0.o setdef1.o
@@ -46,21 +42,9 @@ ${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBALPHA} ${CRT} vers.o setdef0.o setdef1.o
${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} $<
+ ${CC} -c $<
setdef0.o: setdefs.h
diff --git a/sys/boot/alpha/boot2/help.alpha b/sys/boot/alpha/boot2/help.alpha
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/sys/boot/alpha/boot2/help.alpha
+++ /dev/null
diff --git a/sys/boot/alpha/boot2/newvers.sh b/sys/boot/alpha/boot2/newvers.sh
index 978c16489867..88cc010175bb 100644
--- a/sys/boot/alpha/boot2/newvers.sh
+++ b/sys/boot/alpha/boot2/newvers.sh
@@ -35,7 +35,6 @@
#
# @(#)newvers.sh 8.1 (Berkeley) 4/20/94
-LC_TIME=C; export LC_TIME
u=${USER-root} h=`hostname` t=`date`
r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '`
diff --git a/sys/boot/alpha/common/main.c b/sys/boot/alpha/common/main.c
index 41400240b26e..365e5c4cd98c 100644
--- a/sys/boot/alpha/common/main.c
+++ b/sys/boot/alpha/common/main.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: main.c,v 1.8 1998/10/31 17:12:32 dfr Exp $
+ * $Id: main.c,v 1.4 1998/09/03 02:10:02 msmith Exp $
*/
@@ -63,50 +63,6 @@ memsize()
return total;
}
-static void
-extend_heap()
-{
- struct rpb *hwrpb = (struct rpb *)HWRPB_ADDR;
- struct mddt *mddtp;
- struct mddt_cluster *memc;
- int i;
- unsigned long total = 0;
- unsigned long startpfn;
- vm_offset_t startva;
- vm_offset_t startpte;
-
- /*
- * Find the last usable memory cluster and add some of its pages
- * to our address space. The 256k allowed by the firmware isn't quite
- * adequate for our needs.
- */
- mddtp = (struct mddt *)(((caddr_t)hwrpb) + hwrpb->rpb_memdat_off);
- for (i = mddtp->mddt_cluster_cnt - 1; i >= 0; i--) {
- memc = &mddtp->mddt_clusters[i];
- if (!(memc->mddt_usage & (MDDT_NONVOLATILE | MDDT_PALCODE)))
- break;
- }
-
- /*
- * We want to extend the heap from 256k to 512k. With 8k pages
- * (assumed), we need 32 pages. We take pages from the end of the
- * last usable memory region, taking care to avoid the memory used
- * by the kernel's message buffer. We allow 4 pages for the
- * message buffer.
- */
- startpfn = memc->mddt_pfn + memc->mddt_pg_cnt - 4 - 32;
- startva = 0x20040000;
- startpte = 0x40000000
- + (((startva >> 23) & 0x3ff) << PAGE_SHIFT)
- + (((startva >> 13) & 0x3ff) << 3);
-
- for (i = 0; i < 32; i++) {
- u_int64_t pte;
- pte = ((startpfn + i) << 32) | 0x1101;
- *(u_int64_t *) (startpte + 8 * i) = pte;
- }
-}
-
void
main(void)
{
@@ -114,27 +70,18 @@ main(void)
char bootfile[128];
/*
- * Initialise the heap as early as possible. Once this is done,
- * alloc() is usable. The stack is buried inside us, so this is
- * safe.
+ * Initialise the heap as early as possible. Once this is done, alloc() is usable.
+ * The stack is buried inside us, so this is safe
*/
- extend_heap();
- setheap((void *)end, (void *)0x20080000);
+ setheap((void *)end, (void *)0x20040000);
-#ifdef LOADER
- /*
- * If this is the two stage disk loader, add the memory used by
- * the first stage to the heap.
- */
- free_region((void *)PRIMARY_LOAD_ADDRESS,
- (void *)SECONDARY_LOAD_ADDRESS);
-#endif
/*
- * XXX Chicken-and-egg problem; we want to have console output
- * early, but some console attributes may depend on reading from
- * eg. the boot device, which we can't do yet. We can use
- * printf() etc. once this is done.
+ * XXX Chicken-and-egg problem; we want to have console output early, but some
+ * console attributes may depend on reading from eg. the boot device, which we
+ * can't do yet.
+ *
+ * We can use printf() etc. once this is done.
*/
cons_probe();
@@ -142,11 +89,6 @@ main(void)
OSFpal();
/*
- * Initialise the block cache
- */
- bcache_init(32, 512); /* 16k XXX tune this */
-
- /*
* March through the device switch probing for things.
*/
for (i = 0; devsw[i] != NULL; i++)
diff --git a/sys/boot/alpha/libalpha/Makefile b/sys/boot/alpha/libalpha/Makefile
index 4928647b7548..a82febf2e2a3 100644
--- a/sys/boot/alpha/libalpha/Makefile
+++ b/sys/boot/alpha/libalpha/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.5 1998/10/14 09:53:25 peter Exp $
+# $Id: Makefile,v 1.4 1998/09/26 10:51:37 dfr Exp $
LIB= alpha
NOPIC= true
@@ -14,7 +14,7 @@ CFLAGS+= -DDEBUG
CFLAGS+= -I${.CURDIR}/../../common -mno-fp-regs \
-I${.CURDIR}/../../.. -I.
-#CFLAGS+= -DDISK_DEBUG
+CFLAGS+= -DDISK_DEBUG
#CPPFLAGS+= -DNO_DISKLABEL
#CPPFLAGS+= -DSAVE_MEMORY
diff --git a/sys/boot/alpha/libalpha/srmdisk.c b/sys/boot/alpha/libalpha/srmdisk.c
index 6b7d17b8e76d..f7427bdb493f 100644
--- a/sys/boot/alpha/libalpha/srmdisk.c
+++ b/sys/boot/alpha/libalpha/srmdisk.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: srmdisk.c,v 1.3 1998/11/02 23:28:10 msmith Exp $
+ * $Id$
*/
/*
@@ -46,7 +46,6 @@
#include <machine/stdarg.h>
#include <machine/prom.h>
-#include "bootstrap.h"
#include "libalpha.h"
#define SRMDISK_SECSIZE 512
@@ -62,16 +61,18 @@
static int bd_init(void);
static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
-static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize);
static int bd_open(struct open_file *f, void *vdev);
static int bd_close(struct open_file *f);
-static void bd_print(int verbose);
struct open_disk {
int od_fd;
int od_unit; /* our unit number */
int od_boff; /* block offset from beginning of SRM disk */
int od_flags;
+#define BD_MODEMASK 0x3
+#define BD_MODEINT13 0x0
+#define BD_MODEEDD1 0x1
+#define BD_MODEEDD3 0x2
#define BD_FLOPPY (1<<2)
u_char od_buf[BUFSIZE]; /* transfer buffer (do we want/need this?) */
};
@@ -83,8 +84,7 @@ struct devsw srmdisk = {
bd_strategy,
bd_open,
bd_close,
- noioctl,
- bd_print
+ noioctl
};
/*
@@ -120,23 +120,6 @@ bd_init(void)
}
/*
- * Print information about disks
- */
-static void
-bd_print(int verbose)
-{
- int i;
- char line[80];
-
- for (i = 0; i < nbdinfo; i++) {
- sprintf(line, " disk%d: SRM drive %s", i, bdinfo[i].bd_name);
- pager_output(line);
- /* XXX more detail? */
- pager_output("\n");
- }
-}
-
-/*
* Attempt to open the disk described by (dev) for use by (f).
*
* Note that the philosophy here is "give them exactly what
@@ -324,17 +307,7 @@ bd_close(struct open_file *f)
}
static int
-bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, void *buf, size_t *rsize)
-{
- struct bcache_devdata bcd;
-
- bcd.dv_strategy = bd_realstrategy;
- bcd.dv_devdata = devdata;
- return(bcache_strategy(&bcd, rw, dblk, size, buf, rsize));
-}
-
-static int
-bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize)
+bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, void *buf, size_t *rsize)
{
prom_return_t ret;
struct open_disk *od = (struct open_disk *)devdata;
diff --git a/sys/boot/alpha/libalpha/start.S b/sys/boot/alpha/libalpha/start.S
index 39c3e48952c6..53063aba11ee 100644
--- a/sys/boot/alpha/libalpha/start.S
+++ b/sys/boot/alpha/libalpha/start.S
@@ -1,5 +1,5 @@
/*
- * $Id: start.S,v 1.1.1.1 1998/08/21 03:17:42 msmith Exp $
+ * $Id$
* From: $NetBSD: start.S,v 1.4 1998/03/28 00:54:15 cgd Exp $
*/
@@ -51,15 +51,16 @@ NESTED(start, 1, ENTRY_FRAME, ra, 0, 0)
Lstartgp:
LDGP(pv)
+#ifndef PRIMARY_BOOTBLOCK
+ lda sp,start /* start stack below text */
+ lda sp,-ENTRY_FRAME(sp)
+#endif
+
lda a0,_edata
lda a1,_end
subq a1,a0,a1
CALL(bzero)
-#if defined(NETBOOT) || defined(LOADER)
- lda sp,stack + 8192 - ENTRY_FRAME
-#endif
-
CALL(main) /* transfer to C */
XLEAF(_rtt, 0)
@@ -82,7 +83,3 @@ LEAF(cpu_number, 0)
call_pal PAL_VMS_mfpr_whami
RET
END(cpu_number)
-
-#if defined(NETBOOT) || defined(LOADER)
-BSS(stack, 8192)
-#endif
diff --git a/sys/boot/alpha/netboot/Makefile b/sys/boot/alpha/netboot/Makefile
index 927522c4b638..bb4a77ea046d 100644
--- a/sys/boot/alpha/netboot/Makefile
+++ b/sys/boot/alpha/netboot/Makefile
@@ -16,7 +16,8 @@ SRCS+= main.c conf.c dev_net.c
CFLAGS+= -mno-fp-regs
CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
CFLAGS+= -I${.OBJDIR}
-CFLAGS+= -DNETBOOT
+# Verbose ls causes extra heap usage
+CFLAGS+= -DVERBOSE_LS
CLEANFILES+= vers.c vers.o gensetdefs.o gensetdefs setdef0.o setdef1.o \
setdefs.h start.o
@@ -28,7 +29,6 @@ CFLAGS+= -I${LIBSTANDDIR}
CFLAGS+= -I${.CURDIR}/..
CRT= start.o
STRIP=
-BINDIR?= /boot
all: ${BASE}
@@ -49,7 +49,7 @@ ${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBALPHA} ${CRT} vers.o setdef0.o setdef1.o
vers.o ${LIBSTAND} ${LIBALPHA} ${LIBSTAND} >${.OBJDIR}/${BASE}.list
start.o: ${.CURDIR}/../libalpha/start.S
- ${CC} -c ${CFLAGS} $<
+ ${CC} -c -DPRIMARY_BOOTBLOCK $<
setdef0.o: setdefs.h