Module Name: src Committed By: tsutsui Date: Tue Mar 5 15:34:53 UTC 2013
Modified Files: src/sys/arch/luna68k/stand/boot: boot.c init_main.c samachdep.h version Log Message: Check netboot and set proper default boot device. Also bump version. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/luna68k/stand/boot/boot.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/luna68k/stand/boot/init_main.c \ src/sys/arch/luna68k/stand/boot/version cvs rdiff -u -r1.9 -r1.10 src/sys/arch/luna68k/stand/boot/samachdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/luna68k/stand/boot/boot.c diff -u src/sys/arch/luna68k/stand/boot/boot.c:1.2 src/sys/arch/luna68k/stand/boot/boot.c:1.3 --- src/sys/arch/luna68k/stand/boot/boot.c:1.2 Mon Jan 21 11:58:12 2013 +++ src/sys/arch/luna68k/stand/boot/boot.c Tue Mar 5 15:34:53 2013 @@ -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 @@ int howto; 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", Index: src/sys/arch/luna68k/stand/boot/init_main.c diff -u src/sys/arch/luna68k/stand/boot/init_main.c:1.5 src/sys/arch/luna68k/stand/boot/init_main.c:1.6 --- src/sys/arch/luna68k/stand/boot/init_main.c:1.5 Mon Jan 21 11:58:12 2013 +++ src/sys/arch/luna68k/stand/boot/init_main.c Tue Mar 5 15:34:53 2013 @@ -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 @@ static int reorder_dipsw(int); int cpuspeed; /* for DELAY() macro */ int hz = 60; int machtype; +char default_file[64]; #define VERS_LOCAL "Phase-31" @@ -117,6 +119,10 @@ main(void) { 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 @@ main(void) 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 @@ main(void) 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) { Index: src/sys/arch/luna68k/stand/boot/version diff -u src/sys/arch/luna68k/stand/boot/version:1.5 src/sys/arch/luna68k/stand/boot/version:1.6 --- src/sys/arch/luna68k/stand/boot/version:1.5 Mon Jan 21 11:58:12 2013 +++ src/sys/arch/luna68k/stand/boot/version Tue Mar 5 15:34:53 2013 @@ -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 @@ is taken as the current. 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. Index: src/sys/arch/luna68k/stand/boot/samachdep.h diff -u src/sys/arch/luna68k/stand/boot/samachdep.h:1.9 src/sys/arch/luna68k/stand/boot/samachdep.h:1.10 --- src/sys/arch/luna68k/stand/boot/samachdep.h:1.9 Tue Jan 22 15:48:40 2013 +++ src/sys/arch/luna68k/stand/boot/samachdep.h Tue Mar 5 15:34:53 2013 @@ -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 @@ void bmdclear(void); /* 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 cpuspeed; extern int hz; extern int nplane; extern int machtype; +extern char default_file[]; /* kbd.c */ int kbd_decode(u_char);