Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/stand/pxeboot add "consdev" from ../boot.
details: https://anonhg.NetBSD.org/src/rev/ee4998df329a
branches: trunk
changeset: 583765:ee4998df329a
user: chs <chs%NetBSD.org@localhost>
date: Sun Aug 21 23:02:34 2005 +0000
description:
add "consdev" from ../boot.
make "quit" work like it does in ../boot
(ie. let us try again with a bootloader from a different device).
diffstat:
sys/arch/i386/stand/pxeboot/main.c | 43 ++++++++++++++++++++++++++++++++++++-
1 files changed, 41 insertions(+), 2 deletions(-)
diffs (81 lines):
diff -r a517b1663dd8 -r ee4998df329a sys/arch/i386/stand/pxeboot/main.c
--- a/sys/arch/i386/stand/pxeboot/main.c Sun Aug 21 23:00:12 2005 +0000
+++ b/sys/arch/i386/stand/pxeboot/main.c Sun Aug 21 23:02:34 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.8 2005/06/22 20:42:45 dyoung Exp $ */
+/* $NetBSD: main.c,v 1.9 2005/08/21 23:02:34 chs Exp $ */
/*
* Copyright (c) 1996
@@ -56,12 +56,14 @@
void command_help __P((char *));
void command_quit __P((char *));
void command_boot __P((char *));
+void command_consdev(char *);
const struct bootblk_command commands[] = {
{ "help", command_help },
{ "?", command_help },
{ "quit", command_quit },
{ "boot", command_boot },
+ { "consdev", command_consdev },
{ NULL, NULL },
};
@@ -147,6 +149,7 @@
printf("commands are:\n"
"boot [filename] [-adsqv]\n"
" (ex. \"netbsd.old -s\"\n"
+ "consdev {pc|com[0123]|com[0123]kbd|auto}\n"
"help|?\n"
"quit\n");
}
@@ -155,7 +158,12 @@
void
command_quit(char *arg)
{
- printf("Exiting... goodbye...\n");
+
+ printf("Exiting...\n");
+ delay(1000000);
+ reboot();
+ /* Note: we shouldn't get to this point! */
+ panic("Could not reboot!");
exit(0);
}
@@ -168,3 +176,34 @@
if (parseboot(arg, &filename, &howto))
bootit(filename, howto);
}
+
+static const struct cons_devs {
+ const char *name;
+ u_int tag;
+} cons_devs[] = {
+ { "pc", CONSDEV_PC },
+ { "com0", CONSDEV_COM0 },
+ { "com1", CONSDEV_COM1 },
+ { "com2", CONSDEV_COM2 },
+ { "com3", CONSDEV_COM3 },
+ { "com0kbd", CONSDEV_COM0KBD },
+ { "com1kbd", CONSDEV_COM1KBD },
+ { "com2kbd", CONSDEV_COM2KBD },
+ { "com3kbd", CONSDEV_COM3KBD },
+ { "auto", CONSDEV_AUTO },
+ { 0, 0 } };
+
+void
+command_consdev(char *arg)
+{
+ const struct cons_devs *cdp;
+
+ for (cdp = cons_devs; cdp->name; cdp++) {
+ if (!strcmp(arg, cdp->name)) {
+ initio(cdp->tag);
+ print_banner();
+ return;
+ }
+ }
+ printf("invalid console device.\n");
+}
Home |
Main Index |
Thread Index |
Old Index