Handle bootarg strings passed from firmware prompt properly on LUNA-II.

LUNA-II seems to use a different vector from LUNA to pass bootargs.

Now we can specify RB_ASKNAME and RB_SINGLE at boot on LUNA-II.

Should be pulled up to netbsd-6.
This commit is contained in:
tsutsui 2012-07-28 17:33:53 +00:00
parent b202e26bfe
commit f952e34eb4
2 changed files with 25 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.48 2012/07/23 15:10:17 tsutsui Exp $ */
/* $NetBSD: locore.s,v 1.49 2012/07/28 17:33:53 tsutsui Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -136,13 +136,6 @@ ASENTRY_NOPROFILE(start)
RELOC(hwplanemask,%a0)
movl %d5,%a0@ | save hwplanemask
movl #0x41000000,%a0 | argument of 'x' command on boot
movl %a0@(212),%a0 | (char *)base[53]
RELOC(bootarg,%a1)
movl #63,%d0
1: movb %a0@+,%a1@+ | copy to bootarg
dbra %d0,1b | upto 63 characters
movl #CACHE_OFF,%d0
movc %d0,%cacr | clear and disable on-chip cache(s)
@ -168,6 +161,23 @@ Lstart0:
RELOC(fputype,%a0)
movl %d2,%a0@
/*
* save argument of 'x' command on boot per machine type
* XXX: assume CPU_68040 is LUNA-II
*/
movl #0x41000000,%a0
cmpl #CPU_68040,%d0 | 68040?
jne 1f | no, assume 68030 LUNA
movl %a0@(8),%a0 | arg at (char *)base[2] on LUNA-II
jra Lstart1
1:
movl %a0@(212),%a0 | arg at (char *)base[53] on LUNA
Lstart1:
RELOC(bootarg,%a1)
movl #63,%d0
1: movb %a0@+,%a1@+ | copy to bootarg
dbra %d0,1b | upto 63 characters
/*
* Now that we know what CPU we have, initialize the address error
* and bus error handlers in the vector table:

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.90 2012/07/27 05:36:10 matt Exp $ */
/* $NetBSD: machdep.c,v 1.91 2012/07/28 17:33:53 tsutsui Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.90 2012/07/27 05:36:10 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.91 2012/07/28 17:33:53 tsutsui Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -183,15 +183,17 @@ luna68k_init(void)
boothowto = 0;
i = 0;
/*
* 'bootarg' has;
* 'bootarg' on LUNA has:
* "<args of x command> ENADDR=<addr> HOST=<host> SERVER=<name>"
* where <addr> is MAC address of which network loader used (not
* necessarily same as one at 0x4101.FFE0), <host> and <name>
* are the values of HOST and SERVER environment variables,
* are the values of HOST and SERVER environment variables.
*
* 'bootarg' on LUNA-II has "<args of x command>" only.
*
* NetBSD/luna68k cares only the first argment; any of "sda".
*/
for (cp = bootarg; *cp != ' '; cp++) {
for (cp = bootarg; *cp != ' ' && *cp != 0; cp++) {
BOOT_FLAG(*cp, boothowto);
if (i++ >= sizeof(bootarg))
break;