diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-04-17 12:15:52 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-04-17 12:15:52 +0000 |
commit | 514012e57089c294d50ed614166c0b57bd202da1 (patch) | |
tree | a62b267ed5bdfd92b79d590a485047f70c4e99dc /sys/arch/hppa/stand/cdboot | |
parent | b3a5c8ed10bf88729bd7fe091d198ea0823179a1 (diff) |
new boots
Diffstat (limited to 'sys/arch/hppa/stand/cdboot')
-rw-r--r-- | sys/arch/hppa/stand/cdboot/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/hppa/stand/cdboot/cdboot.c | 27 |
2 files changed, 26 insertions, 5 deletions
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 */ + } } |