summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-04-17 12:15:52 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-04-17 12:15:52 +0000
commit514012e57089c294d50ed614166c0b57bd202da1 (patch)
treea62b267ed5bdfd92b79d590a485047f70c4e99dc /sys
parentb3a5c8ed10bf88729bd7fe091d198ea0823179a1 (diff)
new boots
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/hppa/stand/boot/exec.c12
-rw-r--r--sys/arch/hppa/stand/cdboot/Makefile4
-rw-r--r--sys/arch/hppa/stand/cdboot/cdboot.c27
-rw-r--r--sys/arch/hppa/stand/libsa/libsa.h3
4 files changed, 30 insertions, 16 deletions
diff --git a/sys/arch/hppa/stand/boot/exec.c b/sys/arch/hppa/stand/boot/exec.c
index 10ce60d00b3..1c415b883cd 100644
--- a/sys/arch/hppa/stand/boot/exec.c
+++ b/sys/arch/hppa/stand/boot/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.1 2002/10/24 19:27:15 mickey Exp $ */
+/* $OpenBSD: exec.c,v 1.2 2003/04/17 12:15:51 mickey Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -42,16 +42,8 @@ typedef void (*startfuncp) __P((int, int, int, int, int, int, caddr_t))
__attribute__ ((noreturn));
void
-exec(char *file, void *addr, int howto)
+run_loadfile(u_long *marks, int howto)
{
- u_long marks[MARK_MAX];
-
- marks[MARK_START] = (u_long)addr;
-
- if (loadfile(file, marks, LOAD_KERNEL))
- return;
-
- marks[MARK_END] = ALIGN(marks[MARK_END] - (u_long)addr);
fcacheall();
__asm("mtctl %r0, %cr17");
diff --git a/sys/arch/hppa/stand/cdboot/Makefile b/sys/arch/hppa/stand/cdboot/Makefile
index 82f461484ad..2cdf8619217 100644
--- a/sys/arch/hppa/stand/cdboot/Makefile
+++ b/sys/arch/hppa/stand/cdboot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.2 2003/04/15 18:07:32 mickey Exp $
+# $OpenBSD: Makefile,v 1.3 2003/04/17 12:15:51 mickey Exp $
NOMAN= no man
S =${.CURDIR}/../../../..
@@ -7,7 +7,7 @@ CLEANFILES+= cdboot.gdb cdboot.map
.if ${MACHINE} == "hppa"
PROG= cdboot
-SRCS= srt0.S exec.c cdboot.c pdc.c itecons.c dev_hppa.c dk.c
+SRCS= srt0.S cdboot.c pdc.c itecons.c dev_hppa.c dk.c
LD?= ld
LDFLAGS+=-Bstatic -nostartfiles -nostdlib -N -Ttext $(LINKADDR)
LDFLAGS+=-T ${.CURDIR}/ld.script -Map cdboot.map
diff --git a/sys/arch/hppa/stand/cdboot/cdboot.c b/sys/arch/hppa/stand/cdboot/cdboot.c
index bc21cd2961c..a84c179f415 100644
--- a/sys/arch/hppa/stand/cdboot/cdboot.c
+++ b/sys/arch/hppa/stand/cdboot/cdboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cdboot.c,v 1.2 2003/04/15 18:07:32 mickey Exp $ */
+/* $OpenBSD: cdboot.c,v 1.3 2003/04/17 12:15:51 mickey Exp $ */
/*
* Copyright (c) 2003 Michael Shalayeff
@@ -37,9 +37,12 @@
#include <sys/stat.h>
#include <libsa.h>
#include <lib/libsa/cd9660.h>
+#include <lib/libsa/loadfile.h>
#include <dev/cons.h>
+#include <machine/pdc.h>
+#include <stand/boot/bootarg.h>
+#include "dev_hppa.h"
-char path[128];
dev_t bootdev;
int debug = 1;
@@ -60,10 +63,16 @@ struct consdev constab[] = {
};
struct consdev *cn_tab;
+typedef void (*startfuncp) __P((int, int, int, int, int, int, caddr_t))
+ __attribute__ ((noreturn));
+
void
boot(dev)
dev_t dev;
{
+ u_long marks[MARK_MAX];
+ char path[128];
+
pdc_init();
cninit();
devboot(dev, path);
@@ -71,5 +80,17 @@ boot(dev)
printf(">> OpenBSD/" MACHINE " CDBOOT 0.1\n"
"booting %s: ", path);
- exec(path, (void *)DEFAULT_KERNEL_ADDRESS, 0);
+ marks[MARK_START] = (u_long)DEFAULT_KERNEL_ADDRESS;
+ if (!loadfile(path, marks, LOAD_KERNEL)) {
+ marks[MARK_END] = ALIGN(marks[MARK_END] -
+ (u_long)DEFAULT_KERNEL_ADDRESS);
+ fcacheall();
+
+ __asm("mtctl %r0, %cr17");
+ __asm("mtctl %r0, %cr17");
+ (*(startfuncp)(marks[MARK_ENTRY]))((int)pdc, 0, bootdev,
+ marks[MARK_END], BOOTARG_APIVER, BOOTARG_LEN,
+ (caddr_t)BOOTARG_OFF);
+ /* not reached */
+ }
}
diff --git a/sys/arch/hppa/stand/libsa/libsa.h b/sys/arch/hppa/stand/libsa/libsa.h
index 54c1347c88a..5539230bfae 100644
--- a/sys/arch/hppa/stand/libsa/libsa.h
+++ b/sys/arch/hppa/stand/libsa/libsa.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: libsa.h,v 1.11 2003/04/16 07:20:50 mickey Exp $ */
+/* $OpenBSD: libsa.h,v 1.12 2003/04/17 12:15:51 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -64,6 +64,7 @@ void ite_pollc(dev_t, int);
void machdep(void);
void devboot(dev_t, char *);
void fcacheall(void);
+void run_loadfile(u_long *marks, int howto);
int lif_open(char *path, struct open_file *f);
int lif_close(struct open_file *f);