diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2006-07-30 21:38:13 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2006-07-30 21:38:13 +0000 |
commit | 5dc3e6803ec9affc1b5bb26a874e21a7a1082c79 (patch) | |
tree | 4388934d3cf823021f57cbc44686355b70237d52 /sys/arch/armish/stand | |
parent | dd310336151729c090a7c615a2ee80a75c02ea69 (diff) |
With new kernel and bootloader, argument passing now works, version 1.0.
(and yes this does work on iodata and thecus)
Diffstat (limited to 'sys/arch/armish/stand')
-rw-r--r-- | sys/arch/armish/stand/boot/conf.c | 4 | ||||
-rw-r--r-- | sys/arch/armish/stand/boot/exec.c | 28 |
2 files changed, 29 insertions, 3 deletions
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]))(); |