summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/armish/armish/armish_machdep.c6
-rw-r--r--sys/arch/armish/armish/autoconf.c12
-rw-r--r--sys/arch/armish/include/bootconfig.h6
-rw-r--r--sys/arch/armish/stand/boot/conf.c4
-rw-r--r--sys/arch/armish/stand/boot/exec.c28
5 files changed, 47 insertions, 9 deletions
diff --git a/sys/arch/armish/armish/armish_machdep.c b/sys/arch/armish/armish/armish_machdep.c
index c0d51eff28c..f9780ee06a5 100644
--- a/sys/arch/armish/armish/armish_machdep.c
+++ b/sys/arch/armish/armish/armish_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armish_machdep.c,v 1.6 2006/07/20 02:48:03 deraadt Exp $ */
+/* $OpenBSD: armish_machdep.c,v 1.7 2006/07/30 21:38:12 drahn Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -361,7 +361,7 @@ initarm(void *arg)
*/
/* XXX should really be done after setting up the console, but we
* XXX need to parse the console selection flags right now. */
-// process_kernel_args((char *)0xa0200000 - MAX_BOOT_STRING - 1);
+ process_kernel_args((char *)0xa0200000 - MAX_BOOT_STRING - 1);
#ifdef RAMDISK_HOOKS
boothowto |= RB_DFLTROOT;
#endif /* RAMDISK_HOOKS */
@@ -802,8 +802,10 @@ process_kernel_args(char *args)
boot_args = cp;
+#if 0
printf("bootfile: %s\n", boot_file);
printf("bootargs: %s\n", boot_args);
+#endif
/* Setup pointer to boot flags */
while (*cp != '-')
diff --git a/sys/arch/armish/armish/autoconf.c b/sys/arch/armish/armish/autoconf.c
index f64386665ba..01995c51ec0 100644
--- a/sys/arch/armish/armish/autoconf.c
+++ b/sys/arch/armish/armish/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.2 2006/05/31 05:51:20 drahn Exp $ */
+/* $OpenBSD: autoconf.c,v 1.3 2006/07/30 21:38:12 drahn Exp $ */
/* $NetBSD: autoconf.c,v 1.2 2001/09/05 16:17:36 matt Exp $ */
/*
@@ -299,7 +299,15 @@ rootconf()
/* Lookup boot device from boot if not set by configuration */
if (bootdv == NULL) {
- bootdv = parsedisk(boot_file, strlen(boot_file), 0, &temp);
+ int len;
+ char *p;
+ /* boot_file is of the form wd0a:/bsd, we want 'wd0a' */
+ if ((p = strchr(boot_file, ':')) != NULL)
+ len = p - boot_file;
+ else
+ len = strlen(boot_file);
+
+ bootdv = parsedisk(boot_file, len, 0, &temp);
}
if (bootdv == NULL) {
printf("boot device: lookup '%s' failed.\n", boot_file);
diff --git a/sys/arch/armish/include/bootconfig.h b/sys/arch/armish/include/bootconfig.h
index 4f804900052..5903977c2e9 100644
--- a/sys/arch/armish/include/bootconfig.h
+++ b/sys/arch/armish/include/bootconfig.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bootconfig.h,v 1.1 2006/05/29 17:13:19 drahn Exp $ */
+/* $OpenBSD: bootconfig.h,v 1.2 2006/07/30 21:38:12 drahn Exp $ */
/* $NetBSD: bootconfig.h,v 1.2 2001/06/21 22:08:28 chris Exp $ */
/*
@@ -48,7 +48,7 @@ typedef struct _PhysMem {
u_int pages;
} PhysMem;
-#if defined(_KERNEL)
+#if defined(_KERNEL) || defined(_STANDALONE)
#define DRAM_BLOCKS 1
@@ -67,6 +67,8 @@ extern BootConfig bootconfig;
#define BOOTOPT_TYPE_HEXINT 4
#define BOOTOPT_TYPE_MASK 7
+#endif /* _KERNEL || _STANDALONE */
+#if defined(_KERNEL)
int get_bootconf_option (char *string, char *option, int type, void *result);
extern char *boot_args;
diff --git a/sys/arch/armish/stand/boot/conf.c b/sys/arch/armish/stand/boot/conf.c
index 4fe508eb61d..94961592fc3 100644
--- a/sys/arch/armish/stand/boot/conf.c
+++ b/sys/arch/armish/stand/boot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.2 2006/07/29 15:01:49 kettenis Exp $ */
+/* $OpenBSD: conf.c,v 1.3 2006/07/30 21:38:12 drahn Exp $ */
/* $NetBSD: conf.c,v 1.4 2005/12/11 12:17:06 christos Exp $ */
/*
@@ -39,7 +39,7 @@
#include "libsa.h"
#include <lib/libsa/ufs.h>
-const char version[] = "0.9";
+const char version[] = "1.0";
int debug = 0;
/*
diff --git a/sys/arch/armish/stand/boot/exec.c b/sys/arch/armish/stand/boot/exec.c
index 7561e953100..7880e71754e 100644
--- a/sys/arch/armish/stand/boot/exec.c
+++ b/sys/arch/armish/stand/boot/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.2 2006/07/28 19:31:12 kettenis Exp $ */
+/* $OpenBSD: exec.c,v 1.3 2006/07/30 21:38:12 drahn Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis
@@ -24,6 +24,10 @@
#include <sys/exec_elf.h>
#endif
+#include <sys/reboot.h>
+#include <stand/boot/cmd.h>
+#include <machine/bootconfig.h>
+
typedef void (*startfuncp)(void) __attribute__ ((noreturn));
void
@@ -33,6 +37,7 @@ run_loadfile(u_long *marks, int howto)
Elf_Ehdr *elf = (Elf_Ehdr *)marks[MARK_SYM];
Elf_Shdr *shp = (Elf_Shdr *)(marks[MARK_SYM] + elf->e_shoff);
u_long esym = marks[MARK_END];
+ char *cp;
int i;
/*
@@ -50,6 +55,27 @@ run_loadfile(u_long *marks, int howto)
}
}
#endif
+ cp = (char *)0x00200000 - MAX_BOOT_STRING - 1;
+
+#define BOOT_STRING_MAGIC 0x4f425344
+
+ *(int *)cp = BOOT_STRING_MAGIC;
+
+ cp += sizeof(int);
+ snprintf(cp, MAX_BOOT_STRING, "%s:%s -", cmd.bootdev, cmd.image);
+
+ while (*cp != '\0')
+ cp++;
+ if (howto & RB_ASKNAME)
+ *cp++ = 'a';
+ if (howto & RB_CONFIG)
+ *cp++ = 'c';
+ if (howto & RB_KDB)
+ *cp++ = 'd';
+ if (howto & RB_SINGLE)
+ *cp++ = 's';
+
+ *cp = '\0';
(*(startfuncp)(marks[MARK_ENTRY]))();