summaryrefslogtreecommitdiff
path: root/sys/arch/cats
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2004-02-12 02:32:35 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2004-02-12 02:32:35 +0000
commit1528d636e1ac4eb0904e69192982d146d1c5c565 (patch)
tree22bbf5b28d88020133fc679059d114da2c0e4c3f /sys/arch/cats
parent67c45f27a02fa08b54ce43ed2e10146b295ba2a3 (diff)
Correctly parse the firmware 'arguments', allows for the passing of the
root drive. add a couple of options to force console 'f' fcom, 'v' vga
Diffstat (limited to 'sys/arch/cats')
-rw-r--r--sys/arch/cats/cats/autoconf.c10
-rw-r--r--sys/arch/cats/cats/cats_machdep.c40
2 files changed, 39 insertions, 11 deletions
diff --git a/sys/arch/cats/cats/autoconf.c b/sys/arch/cats/cats/autoconf.c
index 965e02cef0b..0209522ec52 100644
--- a/sys/arch/cats/cats/autoconf.c
+++ b/sys/arch/cats/cats/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.2 2004/02/11 14:40:52 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.3 2004/02/12 02:32:34 drahn Exp $ */
/* $NetBSD: autoconf.c,v 1.2 2001/09/05 16:17:36 matt Exp $ */
/*
@@ -72,7 +72,7 @@ void diskconf(void);
static struct device * getdisk(char *str, int len, int defpart, dev_t *devp);
struct device *parsedisk(char *, int, int, dev_t *);
-dev_t bootdev = 0;
+extern char *boot_file;
#include "wd.h"
#if NWD > 0
@@ -333,14 +333,12 @@ rootconf()
bootdv = getdisk(buf, len, part, &rootdev);
}
-#if 0
/* Lookup boot device from boot if not set by configuration */
if(bootdv == NULL) {
- bootdv = parsedisk(bootdev, strlen(bootdev), 0, &temp);
+ bootdv = parsedisk(boot_file, strlen(boot_file), 0, &temp);
}
-#endif
if(bootdv == NULL) {
- printf("boot device: lookup '%s' failed.\n", bootdev);
+ printf("boot device: lookup '%s' failed.\n", boot_file);
boothowto |= RB_ASKNAME; /* Don't Panic :-) */
/* boothowto |= RB_SINGLE; */
} else
diff --git a/sys/arch/cats/cats/cats_machdep.c b/sys/arch/cats/cats/cats_machdep.c
index 9911e0d0350..0f794be1f5e 100644
--- a/sys/arch/cats/cats/cats_machdep.c
+++ b/sys/arch/cats/cats/cats_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cats_machdep.c,v 1.2 2004/02/11 22:07:51 miod Exp $ */
+/* $OpenBSD: cats_machdep.c,v 1.3 2004/02/12 02:32:34 drahn Exp $ */
/* $NetBSD: cats_machdep.c,v 1.50 2003/10/04 14:28:28 chris Exp $ */
/*
@@ -205,9 +205,8 @@ extern void configure(void);
#endif
#endif
-#define CONSDEVNAME "fcom"
#ifndef CONSDEVNAME
-#define CONSDEVNAME "vga"
+#define CONSDEVNAME "fcom"
#endif
#define CONSPEED B38400
@@ -901,6 +900,8 @@ debugledaddr = (void*)(DC21285_PCI_IO_VBASE+DEBUG_LED_OFFSET);
return(kernelstack.pv_va + USPACE_SVC_STACK_TOP);
}
+char *console = CONSDEVNAME;
+
static void
process_kernel_args(args)
char *args;
@@ -914,18 +915,48 @@ process_kernel_args(args)
args = bootargs;
boot_file = bootargs;
+again:
/* Skip the kernel image filename */
while (*args != ' ' && *args != 0)
++args;
if (*args != 0)
*args++ = 0;
+ if (0 == strcmp(boot_file, "setargs")) {
+ boot_file = args;
+ goto again;
+ }
while (*args == ' ')
++args;
-
boot_args = args;
+ while (*args) {
+ switch (*args++) {
+ case 'a':
+ boothowto |= RB_ASKNAME;
+ break;
+ case 's':
+ boothowto |= RB_SINGLE;
+ break;
+ case 'd':
+ boothowto |= RB_KDB;
+ break;
+ case 'c':
+ boothowto |= RB_CONFIG;
+ break;
+ case 'v':
+ console = "vga";
+ break;
+ case 'f':
+ console = "fcom";
+ break;
+ default:
+ break;
+ }
+ }
+
+
printf("bootfile: %s\n", boot_file);
printf("bootargs: %s\n", boot_args);
@@ -942,7 +973,6 @@ void
consinit(void)
{
static int consinit_called = 0;
- char *console = CONSDEVNAME;
if (consinit_called != 0)
return;