summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-04-15 18:07:33 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-04-15 18:07:33 +0000
commit674882c9999610cf15e254616fd1ccf9a5b70cf8 (patch)
tree7eba7654ec04dce6053e1f021acf0551ee456da4 /sys/arch
parent613867004b401967700ab20cacf7b9dd19641447 (diff)
rearrange devsw to place dk in the beginning. necessary glue hookups in cdboot
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/hppa/stand/boot/conf.c4
-rw-r--r--sys/arch/hppa/stand/cdboot/Makefile5
-rw-r--r--sys/arch/hppa/stand/cdboot/cdboot.c41
-rw-r--r--sys/arch/hppa/stand/cdboot/conf.c57
-rw-r--r--sys/arch/hppa/stand/libsa/dev_hppa.c10
5 files changed, 40 insertions, 77 deletions
diff --git a/sys/arch/hppa/stand/boot/conf.c b/sys/arch/hppa/stand/boot/conf.c
index 83af3f338d4..05dbd61620d 100644
--- a/sys/arch/hppa/stand/boot/conf.c
+++ b/sys/arch/hppa/stand/boot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.17 2003/01/14 18:57:20 mickey Exp $ */
+/* $OpenBSD: conf.c,v 1.18 2003/04/15 18:07:32 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -50,8 +50,8 @@ struct fs_ops file_system[] = {
int nfsys = NENTS(file_system);
struct devsw devsw[] = {
- { "ct", iodcstrategy, ctopen, ctclose, noioctl },
{ "dk", iodcstrategy, dkopen, dkclose, noioctl },
+ { "ct", iodcstrategy, ctopen, ctclose, noioctl },
{ "lf", iodcstrategy, lfopen, lfclose, noioctl }
};
int ndevs = NENTS(devsw);
diff --git a/sys/arch/hppa/stand/cdboot/Makefile b/sys/arch/hppa/stand/cdboot/Makefile
index 6c096ebad3d..82f461484ad 100644
--- a/sys/arch/hppa/stand/cdboot/Makefile
+++ b/sys/arch/hppa/stand/cdboot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.1 2003/03/28 22:42:26 mickey Exp $
+# $OpenBSD: Makefile,v 1.2 2003/04/15 18:07:32 mickey Exp $
NOMAN= no man
S =${.CURDIR}/../../../..
@@ -7,8 +7,7 @@ CLEANFILES+= cdboot.gdb cdboot.map
.if ${MACHINE} == "hppa"
PROG= cdboot
-SRCS= srt0.S exec.c cdboot.c conf.c \
- machdep.c pdc.c itecons.c dev_hppa.c dk.c
+SRCS= srt0.S exec.c 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 4855343fcd7..bc21cd2961c 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.1 2003/03/28 22:42:26 mickey Exp $ */
+/* $OpenBSD: cdboot.c,v 1.2 2003/04/15 18:07:32 mickey Exp $ */
/*
* Copyright (c) 2003 Michael Shalayeff
@@ -36,19 +36,40 @@
#include <sys/reboot.h>
#include <sys/stat.h>
#include <libsa.h>
+#include <lib/libsa/cd9660.h>
+#include <dev/cons.h>
-char kernel[] = "/bsd";
+char path[128];
+dev_t bootdev;
+int debug = 1;
-extern const char version[];
+struct fs_ops file_system[] = {
+ { cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
+ cd9660_stat, cd9660_readdir },
+};
+int nfsys = NENTS(file_system);
+
+struct devsw devsw[] = {
+ { "dk", iodcstrategy, dkopen, dkclose, noioctl },
+};
+int ndevs = NENTS(devsw);
+
+struct consdev constab[] = {
+ { ite_probe, ite_init, ite_getc, ite_putc },
+ { NULL }
+};
+struct consdev *cn_tab;
void
-boot(bootdev)
- dev_t bootdev;
+boot(dev)
+ dev_t dev;
{
- machdep();
-
- printf(">> OpenBSD/" MACHINE " BOOT %s\n"
- "booting %s: ", version, kernel);
+ pdc_init();
+ cninit();
+ devboot(dev, path);
+ strncpy(path + strlen(path), ":/bsd.rd", 9);
+ printf(">> OpenBSD/" MACHINE " CDBOOT 0.1\n"
+ "booting %s: ", path);
- exec(kernel, (void *)DEFAULT_KERNEL_ADDRESS, 0);
+ exec(path, (void *)DEFAULT_KERNEL_ADDRESS, 0);
}
diff --git a/sys/arch/hppa/stand/cdboot/conf.c b/sys/arch/hppa/stand/cdboot/conf.c
deleted file mode 100644
index cf96b131013..00000000000
--- a/sys/arch/hppa/stand/cdboot/conf.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* $OpenBSD: conf.c,v 1.1 2003/03/28 22:42:26 mickey Exp $ */
-
-/*
- * Copyright (c) 2003 Michael Shalayeff
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Michael Shalayeff.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF MIND,
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <libsa.h>
-#include <lib/libsa/cd9660.h>
-#include <dev/cons.h>
-
-const char version[] = "0.1";
-int debug = 0;
-
-struct fs_ops file_system[] = {
- { cd9660_open, cd9660_close, cd9660_read, cd9660_write, cd9660_seek,
- cd9660_stat, cd9660_readdir },
-};
-int nfsys = NENTS(file_system);
-
-struct devsw devsw[] = {
- { "dk", iodcstrategy, dkopen, dkclose, noioctl },
-};
-int ndevs = NENTS(devsw);
-
-struct consdev constab[] = {
- { ite_probe, ite_init, ite_getc, ite_putc },
- { NULL }
-};
-struct consdev *cn_tab;
-
diff --git a/sys/arch/hppa/stand/libsa/dev_hppa.c b/sys/arch/hppa/stand/libsa/dev_hppa.c
index 71bbcc41fb3..0c38ac0c634 100644
--- a/sys/arch/hppa/stand/libsa/dev_hppa.c
+++ b/sys/arch/hppa/stand/libsa/dev_hppa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev_hppa.c,v 1.6 2003/01/14 11:38:56 mickey Exp $ */
+/* $OpenBSD: dev_hppa.c,v 1.7 2003/04/15 18:07:32 mickey Exp $ */
/*
* Copyright (c) 1998 Michael Shalayeff
@@ -54,8 +54,8 @@ const struct pdc_devs {
char name[3];
int dev_type;
} pdc_devs[] = {
- { "ct", 0 },
- { "dk", 1 },
+ { "dk", 0 },
+ { "ct", 1 },
{ "lf", 2 },
{ "", -1 },
{ "rd", -1 },
@@ -133,11 +133,11 @@ devboot(dev, p)
switch (PAGE0->mem_boot.pz_class) {
case PCL_RANDOM:
- type = 1;
+ type = 0;
unit = PAGE0->mem_boot.pz_layers[0];
break;
case PCL_SEQU:
- type = 0;
+ type = 1;
unit = PAGE0->mem_boot.pz_layers[0];
break;
case PCL_NET_MASK|PCL_SEQU: