Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/luna68k/stand/boot Check netboot and set proper def...
details: https://anonhg.NetBSD.org/src/rev/dcf0aba9f08b
branches: trunk
changeset: 785235:dcf0aba9f08b
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Tue Mar 05 15:34:53 2013 +0000
description:
Check netboot and set proper default boot device.
Also bump version.
diffstat:
sys/arch/luna68k/stand/boot/boot.c | 3 +--
sys/arch/luna68k/stand/boot/init_main.c | 27 ++++++++++++++++++++++++++-
sys/arch/luna68k/stand/boot/samachdep.h | 4 ++--
sys/arch/luna68k/stand/boot/version | 3 ++-
4 files changed, 31 insertions(+), 6 deletions(-)
diffs (130 lines):
diff -r 9b513ada7e3b -r dcf0aba9f08b sys/arch/luna68k/stand/boot/boot.c
--- a/sys/arch/luna68k/stand/boot/boot.c Tue Mar 05 13:42:04 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/boot.c Tue Mar 05 15:34:53 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: boot.c,v 1.2 2013/01/21 11:58:12 tsutsui Exp $ */
+/* $NetBSD: boot.c,v 1.3 2013/03/05 15:34:53 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -88,7 +88,6 @@
static int get_boot_device(const char *, int *, int *, int *);
struct exec header;
-char default_file[] = "sd(0,0)netbsd";
char *how_to_info[] = {
"RB_ASKNAME ask for file name to reboot from",
diff -r 9b513ada7e3b -r dcf0aba9f08b sys/arch/luna68k/stand/boot/init_main.c
--- a/sys/arch/luna68k/stand/boot/init_main.c Tue Mar 05 13:42:04 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/init_main.c Tue Mar 05 15:34:53 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init_main.c,v 1.5 2013/01/21 11:58:12 tsutsui Exp $ */
+/* $NetBSD: init_main.c,v 1.6 2013/03/05 15:34:53 tsutsui Exp $ */
/*
* Copyright (c) 1992 OMRON Corporation.
@@ -71,6 +71,7 @@
*/
#include <sys/param.h>
+#include <sys/boot_flag.h>
#include <machine/cpu.h>
#include <luna68k/stand/boot/samachdep.h>
#include <luna68k/stand/boot/stinger.h>
@@ -87,6 +88,7 @@
int cpuspeed; /* for DELAY() macro */
int hz = 60;
int machtype;
+char default_file[64];
#define VERS_LOCAL "Phase-31"
@@ -117,6 +119,10 @@
{
int i, status = 0;
const char *machstr;
+ const char *cp;
+ char bootarg[64];
+ bool netboot = false;
+ int unit, part;
/*
* Initialize the console before we print anything out.
@@ -126,11 +132,25 @@
machstr = "LUNA-I";
cpuspeed = MHZ_25;
hz = 60;
+ memcpy(bootarg, (char *)*RVPtr->vec53, sizeof(bootarg));
+
+ /* check netboot */
+ for (i = 0, cp = bootarg; i < sizeof(bootarg); i++, cp++) {
+ if (*cp == '\0')
+ break;
+ if (*cp == 'E' && memcmp("ENADDR=", cp, 7) == 0) {
+ netboot = true;
+ break;
+ }
+ }
} else {
machtype = LUNA_II;
machstr = "LUNA-II";
cpuspeed = MHZ_25 * 2; /* XXX */
hz = 100;
+ memcpy(bootarg, (char *)*RVPtr->vec02, sizeof(bootarg));
+
+ /* LUNA-II's boot monitor doesn't support netboot */
}
nplane = get_plane_numbers();
@@ -165,6 +185,11 @@
configure();
printf("\n");
+ unit = 0; /* XXX should parse monitor's Boot-file constant */
+ part = 0;
+ snprintf(default_file, sizeof(default_file),
+ "%s(%d,%d)%s", netboot ? "le" : "sd", unit, part, "netbsd");
+
howto = reorder_dipsw(dipsw2);
if ((howto & 0xFE) == 0) {
diff -r 9b513ada7e3b -r dcf0aba9f08b sys/arch/luna68k/stand/boot/samachdep.h
--- a/sys/arch/luna68k/stand/boot/samachdep.h Tue Mar 05 13:42:04 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/samachdep.h Tue Mar 05 15:34:53 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: samachdep.h,v 1.9 2013/01/22 15:48:40 tsutsui Exp $ */
+/* $NetBSD: samachdep.h,v 1.10 2013/03/05 15:34:53 tsutsui Exp $ */
/*
* Copyright (c) 1982, 1990, 1993
@@ -74,7 +74,6 @@
/* boot.c */
extern int howto;
-extern char default_file[];
int how_to_boot(int, char **);
int boot(int, char **);
int bootnetbsd(char *);
@@ -116,6 +115,7 @@
extern int hz;
extern int nplane;
extern int machtype;
+extern char default_file[];
/* kbd.c */
int kbd_decode(u_char);
diff -r 9b513ada7e3b -r dcf0aba9f08b sys/arch/luna68k/stand/boot/version
--- a/sys/arch/luna68k/stand/boot/version Tue Mar 05 13:42:04 2013 +0000
+++ b/sys/arch/luna68k/stand/boot/version Tue Mar 05 15:34:53 2013 +0000
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.5 2013/01/21 11:58:12 tsutsui Exp $
+$NetBSD: version,v 1.6 2013/03/05 15:34:53 tsutsui Exp $
NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
file is important - make sure the entries are appended on end, last item
@@ -9,3 +9,4 @@
1.2: Add support for secondary SPC SCSI on LUNA-II.
1.3: Add UFS2 support.
1.4: Add support for "awaiting key" to abort autoboot and get boot menu.
+1.5: Check netboot and set proper default boot device.
Home |
Main Index |
Thread Index |
Old Index