diff options
author | jdp <jdp@FreeBSD.org> | 1999-08-14 17:06:11 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1999-08-14 17:06:11 +0000 |
commit | 0c79a3b760574abd9e05a435868a2370dd8de050 (patch) | |
tree | bf809cd83160df611d20aa3bc050b13429c99708 /sys/boot/alpha | |
parent | 07238fa7c9959b3b16bc47e80080f050f3e0e97c (diff) | |
download | FreeBSD-src-0c79a3b760574abd9e05a435868a2370dd8de050.zip FreeBSD-src-0c79a3b760574abd9e05a435868a2370dd8de050.tar.gz |
Append the flags from the "boot" command to those which came from
the SRM environment. This makes the traditional "boot [/kernel] -s"
and similar things work on the Alpha. Since the flags are appended,
they augment and/or override those from the SRM environment.
Diffstat (limited to 'sys/boot/alpha')
-rw-r--r-- | sys/boot/alpha/libalpha/elf_freebsd.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/boot/alpha/libalpha/elf_freebsd.c b/sys/boot/alpha/libalpha/elf_freebsd.c index e2cadae..0958b95 100644 --- a/sys/boot/alpha/libalpha/elf_freebsd.c +++ b/sys/boot/alpha/libalpha/elf_freebsd.c @@ -1,4 +1,4 @@ -/* $Id: elf_freebsd.c,v 1.5 1998/10/14 09:53:25 peter Exp $ */ +/* $Id: elf_freebsd.c,v 1.6 1998/10/15 21:55:58 dfr Exp $ */ /* $NetBSD: loadfile.c,v 1.10 1998/06/25 06:45:46 ross Exp $ */ /*- @@ -105,6 +105,7 @@ elf_exec(struct loaded_module *mp) struct module_metadata *md; Elf_Ehdr *hdr; int err; + int flen; if ((md = mod_findmetadata(mp, MODINFOMD_ELFHDR)) == NULL) return(EFTYPE); /* XXX actually EFUCKUP */ @@ -121,7 +122,7 @@ elf_exec(struct loaded_module *mp) */ strncpy(bootinfo_v1.booted_kernel, mp->m_name, sizeof(bootinfo_v1.booted_kernel)); - prom_getenv(PROM_E_BOOTED_OSFLAGS, bootinfo_v1.boot_flags, + flen = prom_getenv(PROM_E_BOOTED_OSFLAGS, bootinfo_v1.boot_flags, sizeof(bootinfo_v1.boot_flags)); bootinfo_v1.hwrpb = (void *)HWRPB_ADDR; bootinfo_v1.hwrpbsize = ((struct rpb *)HWRPB_ADDR)->rpb_size; @@ -129,6 +130,26 @@ elf_exec(struct loaded_module *mp) bootinfo_v1.cnputc = NULL; bootinfo_v1.cnpollc = NULL; + /* + * Append the boot command flags. + */ + if (mp->m_args != NULL && *mp->m_args != '\0') { + const char *p = mp->m_args; + + do { + if (*p == '-') { + while (*++p != ' ' && *p != '\0') + if (flen < sizeof(bootinfo_v1.boot_flags) - 1) + bootinfo_v1.boot_flags[flen++] = *p; + } else + while (*p != ' ' && *p != '\0') + p++; + while (*p == ' ') + p++; + } while (*p != '\0'); + bootinfo_v1.boot_flags[flen] = '\0'; + } + printf("Entering %s at 0x%lx...\n", mp->m_name, hdr->e_entry); closeall(); alpha_pal_imb(); |