Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen Add support for x86 boot flags:



details:   https://anonhg.NetBSD.org/src/rev/4241d258d989
branches:  trunk
changeset: 582080:4241d258d989
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Jun 15 22:08:08 2005 +0000

description:
Add support for x86 boot flags:
-s boot single user
-a ask root device
XXX -d is ifdef'd out for now, it cause early panic (no console message).

diffstat:

 sys/arch/xen/i386/machdep.c     |   5 +++--
 sys/arch/xen/i386/xen_machdep.c |  27 ++++++++++++++++++++++++---
 sys/arch/xen/include/xen.h      |   3 ++-
 3 files changed, 29 insertions(+), 6 deletions(-)

diffs (104 lines):

diff -r dd6ef7cfbb35 -r 4241d258d989 sys/arch/xen/i386/machdep.c
--- a/sys/arch/xen/i386/machdep.c       Wed Jun 15 20:49:41 2005 +0000
+++ b/sys/arch/xen/i386/machdep.c       Wed Jun 15 22:08:08 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.16 2005/04/25 15:02:07 lukem Exp $       */
+/*     $NetBSD: machdep.c,v 1.17 2005/06/15 22:08:08 bouyer Exp $      */
 /*     NetBSD: machdep.c,v 1.559 2004/07/22 15:12:46 mycroft Exp       */
 
 /*-
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.16 2005/04/25 15:02:07 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.17 2005/06/15 22:08:08 bouyer Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_ibcs2.h"
@@ -1490,6 +1490,7 @@
        x86_bus_space_init();
 #endif /* defined(XEN) && defined(DOM0OPS) */
        consinit();     /* XXX SHOULD NOT BE DONE HERE */
+       xen_parse_cmdline(XEN_PARSE_BOOTFLAGS, NULL);
        /*
         * Initailize PAGE_SIZE-dependent variables.
         */
diff -r dd6ef7cfbb35 -r 4241d258d989 sys/arch/xen/i386/xen_machdep.c
--- a/sys/arch/xen/i386/xen_machdep.c   Wed Jun 15 20:49:41 2005 +0000
+++ b/sys/arch/xen/i386/xen_machdep.c   Wed Jun 15 22:08:08 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xen_machdep.c,v 1.9 2005/05/31 12:44:29 yamt Exp $     */
+/*     $NetBSD: xen_machdep.c,v 1.10 2005/06/15 22:08:08 bouyer Exp $  */
 
 /*
  *
@@ -33,13 +33,14 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_machdep.c,v 1.9 2005/05/31 12:44:29 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_machdep.c,v 1.10 2005/06/15 22:08:08 bouyer Exp $");
 
 #include "opt_xen.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/mount.h>
+#include <sys/reboot.h>
 
 #include <uvm/uvm.h>
 
@@ -126,7 +127,6 @@
        int b, i, ipidx = 0;
        uint32_t xi_ip[5];
 
-
        cmd_line = strncpy(_cmd_line, xen_start_info.cmd_line, 128);
        cmd_line[127] = '\0';
 
@@ -216,6 +216,27 @@
                                    sizeof(xcp->xcp_console));
                        break;
 
+               case XEN_PARSE_BOOTFLAGS:
+                       if (*opt == '-') {
+                               opt++;
+                               while(*opt != '\0') {
+                                       switch(*opt) {
+                                       case 'a':
+                                               boothowto |= RB_ASKNAME;
+                                               break;
+#ifdef notyet /* XXX cause early panic, before console is setup */
+                                       case 'd':
+                                               boothowto |= RB_KDB;
+                                               break;
+#endif
+                                       case 's':
+                                               boothowto |= RB_SINGLE;
+                                               break;
+                                       }
+                                       opt++;
+                               }
+                       }
+                       break;
                }
 
                if (cmd_line)
diff -r dd6ef7cfbb35 -r 4241d258d989 sys/arch/xen/include/xen.h
--- a/sys/arch/xen/include/xen.h        Wed Jun 15 20:49:41 2005 +0000
+++ b/sys/arch/xen/include/xen.h        Wed Jun 15 22:08:08 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xen.h,v 1.14 2005/05/31 12:42:58 yamt Exp $    */
+/*     $NetBSD: xen.h,v 1.15 2005/06/15 22:08:08 bouyer Exp $  */
 
 /*
  *
@@ -45,6 +45,7 @@
 #define        XEN_PARSE_BOOTDEV       0
 #define        XEN_PARSE_NETINFO       1
 #define        XEN_PARSE_CONSOLE       2
+#define        XEN_PARSE_BOOTFLAGS     3
 
 void   xen_parse_cmdline(int, union xen_cmdline_parseinfo *);
 



Home | Main Index | Thread Index | Old Index