direct-io.hg

changeset 11124:b26bf72514aa

Move vga options to their own 'vga=' boot parameter.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Aug 15 16:17:24 2006 +0100 (2006-08-15)
parents 9a277d391ff9
children f43729552603
files docs/src/user.tex xen/drivers/char/console.c
line diff
     1.1 --- a/docs/src/user.tex	Tue Aug 15 16:04:12 2006 +0100
     1.2 +++ b/docs/src/user.tex	Tue Aug 15 16:17:24 2006 +0100
     1.3 @@ -3129,8 +3129,8 @@ editing \path{grub.conf}.
     1.4  \item [ console=$<$specifier list$>$ ] Specify the destination for Xen
     1.5    console I/O.  This is a comma-separated list of, for example:
     1.6    \begin{description}
     1.7 -  \item[ vga ] Use VGA console (only until domain 0 boots, unless {\bf
     1.8 -  vga[keep] } is specified).
     1.9 +  \item[ vga ] Use VGA console (until domain 0 boots, unless {\bf
    1.10 +  vga=keep } is specified).
    1.11    \item[ com1 ] Use serial port com1.
    1.12    \item[ com2H ] Use serial port com2. Transmitted chars will have the
    1.13      MSB set. Received chars must have MSB set.
    1.14 @@ -3141,6 +3141,12 @@ editing \path{grub.conf}.
    1.15    subsystems (e.g.\ console and debugger). Sharing is controlled by
    1.16    MSB of each transmitted/received character.  [NB. Default for this
    1.17    option is `com1,vga']
    1.18 +\item [ vga=$<$options$>$ ] This is a comma-separated list of options:
    1.19 +  \begin{description}
    1.20 +  \item[ text-$<$mode$>$ ] Select text-mode resolution, where mode is
    1.21 +  one of 80x25, 80x28, 80x30, 80x34, 80x43, 80x50, 80x60.
    1.22 +  \item[ keep ] Keep the VGA console even after domain 0 boots.
    1.23 +  \end{description}
    1.24  \item [ sync\_console ] Force synchronous console output. This is
    1.25    useful if you system fails unexpectedly before it has sent all
    1.26    available output to the console. In most cases Xen will
     2.1 --- a/xen/drivers/char/console.c	Tue Aug 15 16:04:12 2006 +0100
     2.2 +++ b/xen/drivers/char/console.c	Tue Aug 15 16:17:24 2006 +0100
     2.3 @@ -32,6 +32,10 @@
     2.4  static char opt_console[30] = OPT_CONSOLE_STR;
     2.5  string_param("console", opt_console);
     2.6  
     2.7 +/* vga: comma-separated options. */
     2.8 +static char opt_vga[30] = "";
     2.9 +string_param("vga", opt_vga);
    2.10 +
    2.11  /* conswitch: a character pair controlling console switching. */
    2.12  /* Char 1: CTRL+<char1> is used to switch console input between Xen and DOM0 */
    2.13  /* Char 2: If this character is 'x', then do not auto-switch to DOM0 when it */
    2.14 @@ -55,7 +59,8 @@ static char printk_prefix[16] = "";
    2.15  
    2.16  static int sercon_handle = -1;
    2.17  static int vgacon_enabled = 0;
    2.18 -static int vgacon_keep = 0;
    2.19 +static int vgacon_keep    = 0;
    2.20 +static int vgacon_lines   = 25;
    2.21  static const struct font_desc *font;
    2.22  
    2.23  static DEFINE_SPINLOCK(console_lock);
    2.24 @@ -66,10 +71,10 @@ static DEFINE_SPINLOCK(console_lock);
    2.25   * *******************************************************
    2.26   */
    2.27  
    2.28 -/* VGA text (mode 3) definitions. */
    2.29 +/* VGA text-mode definitions. */
    2.30  #define COLUMNS     80
    2.31 -#define LINES       vgacon_enabled
    2.32 -#define ATTRIBUTE    7
    2.33 +#define LINES       vgacon_lines
    2.34 +#define ATTRIBUTE   7
    2.35  #define VIDEO_SIZE  (COLUMNS * LINES * 2)
    2.36  
    2.37  /* Clear the screen and initialize VIDEO, XPOS and YPOS.  */
    2.38 @@ -85,6 +90,16 @@ static void init_vga(void)
    2.39      if ( !vgacon_enabled )
    2.40          return;
    2.41  
    2.42 +    for ( p = opt_vga; p != NULL; p = strchr(p, ',') )
    2.43 +    {
    2.44 +        if ( *p == ',' )
    2.45 +            p++;
    2.46 +        if ( strncmp(p, "keep", 4) == 0 )
    2.47 +            vgacon_keep = 1;
    2.48 +        else if ( strncmp(p, "text-80x", 8) == 0 )
    2.49 +            vgacon_lines = simple_strtoul(p + 8, NULL, 10);
    2.50 +    }
    2.51 +
    2.52      video = setup_vga();
    2.53      if ( !video )
    2.54      {
    2.55 @@ -92,7 +107,7 @@ static void init_vga(void)
    2.56          return;
    2.57      }
    2.58  
    2.59 -    switch ( vgacon_enabled )
    2.60 +    switch ( vgacon_lines )
    2.61      {
    2.62      case 25:
    2.63      case 30:
    2.64 @@ -108,13 +123,13 @@ static void init_vga(void)
    2.65          font = &font_vga_8x8;
    2.66          break;
    2.67      default:
    2.68 -        vgacon_enabled = 25;
    2.69 +        vgacon_lines = 25;
    2.70          break;
    2.71      }
    2.72  
    2.73 -    if ( (font != NULL) && (vga_load_font(font, vgacon_enabled) < 0) )
    2.74 +    if ( (font != NULL) && (vga_load_font(font, vgacon_lines) < 0) )
    2.75      {
    2.76 -        vgacon_enabled = 25;
    2.77 +        vgacon_lines = 25;
    2.78          font = NULL;
    2.79      }
    2.80      
    2.81 @@ -438,13 +453,7 @@ void init_console(void)
    2.82          if ( strncmp(p, "com", 3) == 0 )
    2.83              sercon_handle = serial_parse_handle(p);
    2.84          else if ( strncmp(p, "vga", 3) == 0 )
    2.85 -        {
    2.86 -            vgacon_enabled = p[3] < '1' || p[3] > '9'
    2.87 -                             ? (p += 3, 25)
    2.88 -                             : simple_strtol(p + 3, &p, 10);
    2.89 -            if ( strncmp(p, "[keep]", 6) == 0 )
    2.90 -                vgacon_keep = 1;
    2.91 -        }
    2.92 +            vgacon_enabled = 1;
    2.93      }
    2.94  
    2.95      init_vga();