summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Murphree <smurph@cvs.openbsd.org>1998-12-15 06:12:51 +0000
committerSteve Murphree <smurph@cvs.openbsd.org>1998-12-15 06:12:51 +0000
commit6d51a3609c2a75795ae9487536608be366f37cca (patch)
tree859c216821b15cff8eba7e25b5873c6c760e047e
parentee313f9cb07de5488da8b539c105ade3d6864c74 (diff)
Added sdcrt.c to make bootxx and bootsd work.
-rw-r--r--sys/arch/mvme88k/stand/bugcrt/Makefile11
-rw-r--r--sys/arch/mvme88k/stand/bugcrt/Makefile.inc7
-rw-r--r--sys/arch/mvme88k/stand/bugcrt/bugcrt.c18
-rw-r--r--sys/arch/mvme88k/stand/bugcrt/sdcrt.c81
4 files changed, 105 insertions, 12 deletions
diff --git a/sys/arch/mvme88k/stand/bugcrt/Makefile b/sys/arch/mvme88k/stand/bugcrt/Makefile
index 3bb46db9c62..3e5483d2c70 100644
--- a/sys/arch/mvme88k/stand/bugcrt/Makefile
+++ b/sys/arch/mvme88k/stand/bugcrt/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.4 1998/08/22 09:16:45 smurph Exp $
+# $OpenBSD: Makefile,v 1.5 1998/12/15 06:12:50 smurph Exp $
#
# DO NOT OPTMIZE bugcrt (i.e. no "-O2")
#
@@ -6,9 +6,9 @@ S=${.CURDIR}/../../../..
CFLAGS=-I${.CURDIR}/../../include -I${.CURDIR}/../libbug -I${S}/lib/libsa \
-fomit-frame-pointer
-OBJS=bugcrt.o
+OBJS=bugcrt.o sdcrt.o
-CLEANFILES+=a.out
+CLEANFILES+=a.out ${OBJS}
all: ${OBJS}
@@ -17,6 +17,11 @@ bugcrt.o: bugcrt.c
${LD} -x -r ${.TARGET}
mv a.out ${.TARGET}
+sdcrt.o: sdcrt.c
+ ${COMPILE.c} -c $<
+ ${LD} -x -r ${.TARGET}
+ mv a.out ${.TARGET}
+
install:
lint tags:
diff --git a/sys/arch/mvme88k/stand/bugcrt/Makefile.inc b/sys/arch/mvme88k/stand/bugcrt/Makefile.inc
index 13a2b3fdadf..2a793d527a7 100644
--- a/sys/arch/mvme88k/stand/bugcrt/Makefile.inc
+++ b/sys/arch/mvme88k/stand/bugcrt/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.2 1998/08/22 09:16:46 smurph Exp $
+# $OpenBSD: Makefile.inc,v 1.3 1998/12/15 06:12:50 smurph Exp $
BUG_CRT_DIR=${S}/arch/mvme88k/stand/bugcrt
@@ -6,9 +6,14 @@ BUGCRT_DIR!= cd ${BUG_CRT_DIR}; \
printf "xxx:\n\techo \$${.OBJDIR}\n" | ${MAKE} -r -s -f - xxx
BUGCRT=${BUGCRT_DIR}/bugcrt.o
+SDCRT=${BUGCRT_DIR}/sdcrt.o
$(BUGCRT): .NOTMAIN __always_make_bugcrt
@echo making sure the bugcrt is up to date...
@(cd ${BUG_CRT_DIR}; ${MAKE})
+$(SDCRT): .NOTMAIN __always_make_bugcrt
+ @echo making sure the sdcrt is up to date...
+ @(cd ${BUG_CRT_DIR}; ${MAKE})
+
__always_make_bugcrt: .NOTMAIN
diff --git a/sys/arch/mvme88k/stand/bugcrt/bugcrt.c b/sys/arch/mvme88k/stand/bugcrt/bugcrt.c
index 24ab2812579..4d4be412d8b 100644
--- a/sys/arch/mvme88k/stand/bugcrt/bugcrt.c
+++ b/sys/arch/mvme88k/stand/bugcrt/bugcrt.c
@@ -1,12 +1,13 @@
-/* $OpenBSD: bugcrt.c,v 1.3 1998/08/22 09:16:47 smurph Exp $ */
+/* $OpenBSD: bugcrt.c,v 1.4 1998/12/15 06:12:50 smurph Exp $ */
#include <sys/types.h>
#include <machine/prom.h>
struct mvmeprom_args bugargs = { 1 }; /* not BSS */
asm (".text");
- asm (".long 0x003ffff8");
- asm (".long _start");
+ /* pseudo reset vector */
+ asm (".long 0x00Af0000"); /* initial sp value */
+ asm (".long _start"); /* initial ip value */
start()
{
register int dev_lun asm (MVMEPROM_REG_DEVLUN);
@@ -24,10 +25,10 @@ start()
/* Do not use r10 to enable the SFU1. This wipes out
the netboot args. Not cool at all... r25 seems free. */
-asm ("# enable SFU1");
-asm (" ldcr r25,cr1");
-asm (" xor r25,r25,0x8");
-asm (" stcr r25,cr1");
+asm ("| enable SFU1");
+asm (" ldcr r25,cr1");
+asm (" xor r25,r25,0x8");
+asm (" stcr r25,cr1");
bugargs.dev_lun = dev_lun;
bugargs.ctrl_lun = ctrl_lun;
@@ -41,7 +42,8 @@ asm (" stcr r25,cr1");
bugargs.nbarg_end = nbarg_end;
*bugargs.arg_end = 0;
- bzero(&edata, (&end - &edata));
+ memset(&edata, 0, ((int)&end - (int)&edata));
+
id = mvmeprom_brdid();
bugargs.cputyp = id->model;
diff --git a/sys/arch/mvme88k/stand/bugcrt/sdcrt.c b/sys/arch/mvme88k/stand/bugcrt/sdcrt.c
new file mode 100644
index 00000000000..74d8a5e6d7d
--- /dev/null
+++ b/sys/arch/mvme88k/stand/bugcrt/sdcrt.c
@@ -0,0 +1,81 @@
+/* $OpenBSD: sdcrt.c,v 1.1 1998/12/15 06:12:50 smurph Exp $ */
+#include <sys/types.h>
+#include <machine/prom.h>
+
+struct mvmeprom_args bugargs = { 1 }; /* not BSS */
+
+ asm (".text");
+ /* pseudo reset vector */
+ asm (".long 0x003f0000"); /* initial sp value */
+ asm (".long _start"); /* initial ip value */
+start()
+{
+ register int dev_lun asm (MVMEPROM_REG_DEVLUN);
+ register int ctrl_lun asm (MVMEPROM_REG_CTRLLUN);
+ register int flags asm (MVMEPROM_REG_FLAGS);
+ register int ctrl_addr asm (MVMEPROM_REG_CTRLADDR);
+ register int entry asm (MVMEPROM_REG_ENTRY);
+ register int conf_blk asm (MVMEPROM_REG_CONFBLK);
+ register char *arg_start asm (MVMEPROM_REG_ARGSTART);
+ register char *arg_end asm (MVMEPROM_REG_ARGEND);
+ register char *nbarg_start asm (MVMEPROM_REG_NBARGSTART);
+ register char *nbarg_end asm (MVMEPROM_REG_NBARGEND);
+ extern int edata, end;
+ struct mvmeprom_brdid *id, *mvmeprom_brdid();
+
+ bugargs.dev_lun = dev_lun;
+ bugargs.ctrl_lun = ctrl_lun;
+ bugargs.flags = flags;
+ bugargs.ctrl_addr = ctrl_addr;
+ bugargs.entry = entry;
+ bugargs.conf_blk = conf_blk;
+ bugargs.arg_start = arg_start;
+ bugargs.arg_end = arg_end;
+ bugargs.nbarg_start = nbarg_start;
+ bugargs.nbarg_end = nbarg_end;
+ *bugargs.arg_end = 0;
+
+ memset(&edata, 0, ((int)&end - (int)&edata));
+
+ id = mvmeprom_brdid();
+ bugargs.cputyp = id->model;
+
+ main();
+ mvmeprom_return();
+ /* NOTREACHED */
+}
+
+__main()
+{
+}
+
+void
+bugexec(addr)
+
+void (*addr)();
+
+{
+ register int dev_lun asm (MVMEPROM_REG_DEVLUN);
+ register int ctrl_lun asm (MVMEPROM_REG_CTRLLUN);
+ register int flags asm (MVMEPROM_REG_FLAGS);
+ register int ctrl_addr asm (MVMEPROM_REG_CTRLADDR);
+ register int entry asm (MVMEPROM_REG_ENTRY);
+ register int conf_blk asm (MVMEPROM_REG_CONFBLK);
+ register char *arg_start asm (MVMEPROM_REG_ARGSTART);
+ register char *arg_end asm (MVMEPROM_REG_ARGEND);
+
+ dev_lun = bugargs.dev_lun;
+ ctrl_lun = bugargs.ctrl_lun;
+ flags = bugargs.flags;
+ ctrl_addr = bugargs.ctrl_addr;
+ entry = bugargs.entry;
+ conf_blk = bugargs.conf_blk;
+ arg_start = bugargs.arg_start;
+ arg_end = bugargs.arg_end;
+
+ (*addr)();
+ printf("bugexec: 0x%x returned!\n", addr);
+
+ _rtt();
+}
+