ia64/xen-unstable

changeset 680:203cbb0ec54e

bitkeeper revision 1.395 (3f429650-3tSYXLnO0q2TBgXxlEcbw)

console.h, kernel.c, boot.S:
Clean ups.
author kaf24@scramble.cl.cam.ac.uk
date Tue Aug 19 21:27:44 2003 +0000 (2003-08-19)
parents 76b59b68bc65
children 3aa0265ba99b
files xen/arch/i386/boot/boot.S xen/common/kernel.c xen/include/xeno/console.h
line diff
     1.1 --- a/xen/arch/i386/boot/boot.S	Sun Aug 17 10:41:25 2003 +0000
     1.2 +++ b/xen/arch/i386/boot/boot.S	Tue Aug 19 21:27:44 2003 +0000
     1.3 @@ -88,7 +88,7 @@ continue_boot_cpu:
     1.4          cmp     $0x2BADB002,%eax
     1.5          jne     skip_dom0_copy
     1.6          sub     $__PAGE_OFFSET,%ebx          /* turn back into a phys addr */
     1.7 -        mov     0x14(%ebx),%edi              /* mb->mods_count */
     1.8 +        mov     0x14(%ebx),%edi              /* mbi->mods_count */
     1.9          dec     %edi                         /* mbi->mods_count-- */
    1.10          jb      skip_dom0_copy               /* skip if no modules */
    1.11          mov     0x18(%ebx),%eax              /* mbi->mods_addr */
     2.1 --- a/xen/common/kernel.c	Sun Aug 17 10:41:25 2003 +0000
     2.2 +++ b/xen/common/kernel.c	Tue Aug 19 21:27:44 2003 +0000
     2.3 @@ -1,3 +1,12 @@
     2.4 +/******************************************************************************
     2.5 + * kernel.c
     2.6 + * 
     2.7 + * This file should contain architecture-independent bootstrap and low-level
     2.8 + * help routines. It's a bit x86/PC specific right now!
     2.9 + * 
    2.10 + * Copyright (c) 2002-2003 K A Fraser
    2.11 + */
    2.12 +
    2.13  #include <stdarg.h>
    2.14  #include <xeno/lib.h>
    2.15  #include <xeno/errno.h>
    2.16 @@ -10,6 +19,7 @@
    2.17  #include <xeno/interrupt.h>
    2.18  #include <xeno/compile.h>
    2.19  #include <xeno/version.h>
    2.20 +#include <xeno/netdevice.h>
    2.21  #include <asm/io.h>
    2.22  #include <asm/msr.h>
    2.23  #include <asm/uaccess.h>
    2.24 @@ -35,29 +45,37 @@ void init_vga(void);
    2.25  void init_serial(void);
    2.26  void start_of_day(void);
    2.27  
    2.28 -/* Command line options and variables. */
    2.29 -unsigned int opt_console = 1;
    2.30 -unsigned int opt_ser_baud = 9600;  /* default baud for COM1 */
    2.31 -unsigned int opt_dom0_mem = 16000; /* default kbytes for DOM0 */
    2.32 -unsigned int opt_ne_base = 0; /* NE2k NICs cannot be probed */
    2.33 +/* opt_console: If true, Xen sends logging to the VGA console. */
    2.34 +int opt_console = 1;
    2.35 +/* opt_ser_baud: Baud rate at which logging is sent to COM1. */
    2.36 +unsigned int opt_ser_baud = 9600;
    2.37 +/* opt_dom0_mem: Kilobytes of memory allocated to domain 0. */
    2.38 +unsigned int opt_dom0_mem = 16000;
    2.39 +/* opt_ifname: Name of physical network interface to use. */
    2.40  unsigned char opt_ifname[10] = "eth0";
    2.41 -int opt_noht=0, opt_noacpi=0, opt_nosmp=0, opt_watchdog=0;
    2.42 -enum { OPT_IP, OPT_STR, OPT_UINT, OPT_BOOL };
    2.43 +/* opt_noht: If true, Hyperthreading is ignored. */
    2.44 +int opt_noht=0;
    2.45 +/* opt_noacpi: If true, ACPI tables are not parsed. */
    2.46 +int opt_noacpi=0;
    2.47 +/* opt_nosmp: If true, secondary processors are ignored. */
    2.48 +int opt_nosmp=0;
    2.49 +/* opt_watchdog: If true, run a watchdog NMI on each processor. */
    2.50 +int opt_watchdog=0;
    2.51 +
    2.52  static struct {
    2.53      unsigned char *name;
    2.54 -    int type;
    2.55 +    enum { OPT_IP, OPT_STR, OPT_UINT, OPT_BOOL } type;
    2.56      void *var;
    2.57  } opts[] = {
    2.58      { "console",     OPT_UINT, &opt_console },
    2.59      { "ser_baud",    OPT_UINT, &opt_ser_baud },
    2.60      { "dom0_mem",    OPT_UINT, &opt_dom0_mem }, 
    2.61 -    { "ne_base",     OPT_UINT, &opt_ne_base },
    2.62      { "ifname",      OPT_STR,  &opt_ifname },
    2.63      { "noht",        OPT_BOOL, &opt_noht },
    2.64      { "noacpi",      OPT_BOOL, &opt_noacpi },
    2.65      { "nosmp",       OPT_BOOL, &opt_nosmp },
    2.66      { "watchdog",    OPT_BOOL, &opt_watchdog },
    2.67 -    { NULL,       0,        NULL     }
    2.68 +    { NULL,          0,        NULL     }
    2.69  };
    2.70  
    2.71  
    2.72 @@ -71,58 +89,20 @@ void cmain (unsigned long magic, multibo
    2.73      int i;
    2.74  
    2.75      /*
    2.76 -     * Note that serial output cannot be done properly until 
    2.77 -     * after command-line arguments have been parsed, and the required baud 
    2.78 -     * rate is known. Any messages before that will be output using the
    2.79 -     * settings of the bootloader, for example. Maybe okay for error msgs...
    2.80 +     * Note that serial output cannot be done properly until after 
    2.81 +     * command-line arguments have been parsed, and the required baud rate is 
    2.82 +     * known. Any messages before that will be output using the settings of 
    2.83 +     * the bootloader, for example.
    2.84       */
    2.85 -#define early_error(args...) opt_console=1; init_vga(); cls(); printk(args)
    2.86  
    2.87      if ( magic != MULTIBOOT_BOOTLOADER_MAGIC )
    2.88      {
    2.89 -        early_error("Invalid magic number: 0x%x\n", (unsigned)magic);
    2.90 -        return;
    2.91 -    }
    2.92 -
    2.93 -    /*
    2.94 -     * We require some kind of memory and module information.
    2.95 -     * The rest we can fake!
    2.96 -     */
    2.97 -    if ( (mbi->flags & 9) != 9 )
    2.98 -    {
    2.99 -        early_error("Bad flags passed by bootloader: 0x%x\n", (unsigned)mbi->flags);
   2.100 -        return;
   2.101 -    }
   2.102 -
   2.103 -    if ( mbi->mods_count == 0 )
   2.104 -    {
   2.105 -        early_error("Require at least one module!\n");
   2.106 -        return;
   2.107 +        init_vga();
   2.108 +        cls();
   2.109 +        printk("Invalid magic number: 0x%x\n", (unsigned)magic);
   2.110 +        for ( ; ; ) ;
   2.111      }
   2.112  
   2.113 -    /* Are mmap_* valid?  */
   2.114 -#if 0
   2.115 -    if ( (mbi->flags & (1<<6)) )
   2.116 -    {
   2.117 -        memory_map_t *mmap = (memory_map_t *)mbi->mmap_addr;
   2.118 -        struct e820entry *e820 = E820_MAP;
   2.119 -
   2.120 -        while ( (unsigned long)mmap < (mbi->mmap_addr + mbi->mmap_length) )
   2.121 -        {
   2.122 -            e820->addr_lo = mmap->base_addr_low;
   2.123 -            e820->addr_hi = mmap->base_addr_high;
   2.124 -            e820->size_lo = mmap->length_low;
   2.125 -            e820->size_hi = mmap->length_high;
   2.126 -            e820->type    = mmap->type;
   2.127 -            e820++;
   2.128 -            mmap = (memory_map_t *) 
   2.129 -                ((unsigned long)mmap + mmap->size + sizeof (mmap->size));
   2.130 -        }
   2.131 -    }
   2.132 -#endif
   2.133 -
   2.134 -    mod = (module_t *)__va(mbi->mods_addr);
   2.135 -
   2.136      /* Parse the command line. */
   2.137      cmdline = (unsigned char *)(mbi->cmdline ? __va(mbi->cmdline) : NULL);
   2.138      if ( cmdline != NULL )
   2.139 @@ -165,14 +145,10 @@ void cmain (unsigned long magic, multibo
   2.140          }
   2.141      }
   2.142  
   2.143 -#undef early_error
   2.144 -
   2.145 +    init_serial();
   2.146      init_vga();
   2.147      cls();
   2.148  
   2.149 -    /* INITIALISE SERIAL LINE (printk will work okay from here on). */
   2.150 -    init_serial();
   2.151 -
   2.152      printk(XEN_BANNER);
   2.153      printk(" http://www.cl.cam.ac.uk/netos/xen\n");
   2.154      printk(" University of Cambridge Computer Laboratory\n\n");
   2.155 @@ -181,6 +157,20 @@ void cmain (unsigned long magic, multibo
   2.156             XEN_COMPILE_BY, XEN_COMPILE_DOMAIN,
   2.157             XEN_COMPILER, XEN_COMPILE_DATE);
   2.158  
   2.159 +    /* We require memory and module information. */
   2.160 +    if ( (mbi->flags & 9) != 9 )
   2.161 +    {
   2.162 +        printk("FATAL ERROR: Bad flags passed by bootloader: 0x%x\n", 
   2.163 +               (unsigned)mbi->flags);
   2.164 +        for ( ; ; ) ;
   2.165 +    }
   2.166 +
   2.167 +    if ( mbi->mods_count == 0 )
   2.168 +    {
   2.169 +        printk("Require at least one Multiboot module!\n");
   2.170 +        for ( ; ; ) ;
   2.171 +    }
   2.172 +
   2.173      memcpy(&idle0_task_union, &first_task_struct, sizeof(first_task_struct));
   2.174  
   2.175      max_page = (mbi->mem_upper+1024) >> (PAGE_SHIFT - 10);
   2.176 @@ -203,10 +193,11 @@ void cmain (unsigned long magic, multibo
   2.177      if ( new_dom == NULL ) panic("Error creating domain 0\n");
   2.178  
   2.179      /*
   2.180 -     * We're going to setup domain0 using the module(s) that we stashed safely 
   2.181 -     * above our MAX_DIRECTMAP_ADDRESS in boot/Boot.S The second module, if 
   2.182 +     * We're going to setup domain0 using the module(s) that we stashed safely
   2.183 +     * above our MAX_DIRECTMAP_ADDRESS in boot/Boot.S The second module, if
   2.184       * present, is an initrd ramdisk
   2.185       */
   2.186 +    mod = (module_t *)__va(mbi->mods_addr);
   2.187      if ( setup_guestos(new_dom, 
   2.188                         &dom0_params, 1,
   2.189                         (char *)MAX_DIRECTMAP_ADDRESS, 
   2.190 @@ -220,9 +211,11 @@ void cmain (unsigned long magic, multibo
   2.191      wake_up(new_dom);
   2.192  
   2.193      cpu_idle();
   2.194 -}    
   2.195 +}
   2.196  
   2.197  
   2.198 +#ifdef CONFIG_OUTPUT_SERIAL
   2.199 +
   2.200  #define SERIAL_BASE 0x3f8
   2.201  #define RX_BUF      0
   2.202  #define TX_HOLD     0
   2.203 @@ -237,7 +230,6 @@ void cmain (unsigned long magic, multibo
   2.204  
   2.205  void init_serial(void)
   2.206  {
   2.207 -#ifdef CONFIG_OUTPUT_SERIAL
   2.208      /* 'opt_ser_baud' baud, no parity, 1 stop bit, 8 data bits. */
   2.209      outb(0x83, SERIAL_BASE+DATA_FORMAT);
   2.210      outb(115200/opt_ser_baud, SERIAL_BASE+DIVISOR_LO);
   2.211 @@ -246,19 +238,25 @@ void init_serial(void)
   2.212  
   2.213      /* No interrupts. */
   2.214      outb(0x00, SERIAL_BASE+INT_ENABLE);
   2.215 -#endif
   2.216  }
   2.217  
   2.218  
   2.219  void putchar_serial(unsigned char c)
   2.220  {
   2.221 -#ifdef CONFIG_OUTPUT_SERIAL
   2.222      if ( c == '\n' ) putchar_serial('\r');
   2.223      while ( !(inb(SERIAL_BASE+LINE_STATUS)&(1<<5)) ) barrier();
   2.224      outb(c, SERIAL_BASE+TX_HOLD);
   2.225 -#endif
   2.226  }
   2.227  
   2.228 +#else
   2.229 +
   2.230 +void init_serial(void) {}
   2.231 +void putchar_serial(unsigned char c) {}
   2.232 +
   2.233 +#endif
   2.234 +
   2.235 +
   2.236 +#ifdef CONFIG_OUTPUT_CONSOLE
   2.237  
   2.238  /* VGA text (mode 3) definitions. */
   2.239  #define COLUMNS	    80
   2.240 @@ -269,7 +267,6 @@ void putchar_serial(unsigned char c)
   2.241  /* This is actually code from vgaHWRestore in an old version of XFree86 :-) */
   2.242  void init_vga(void)
   2.243  {
   2.244 -#ifdef CONFIG_OUTPUT_CONSOLE
   2.245      /* The following VGA state was saved from a chip in text mode 3. */
   2.246      static unsigned char regs[] = {
   2.247          /* Sequencer registers */
   2.248 @@ -288,97 +285,116 @@ void init_vga(void)
   2.249      int i, j = 0;
   2.250      volatile unsigned char tmp;
   2.251  
   2.252 -    if(opt_console) {
   2.253 -      tmp = inb(0x3da);
   2.254 -      outb(0x00, 0x3c0);
   2.255 -      
   2.256 -      for ( i = 0; i < 5;  i++ )
   2.257 +    if ( !opt_console )
   2.258 +        return;
   2.259 +
   2.260 +    tmp = inb(0x3da);
   2.261 +    outb(0x00, 0x3c0);
   2.262 +    
   2.263 +    for ( i = 0; i < 5;  i++ )
   2.264          outw((regs[j++] << 8) | i, 0x3c4);
   2.265 -      
   2.266 -      /* Ensure CRTC registers 0-7 are unlocked by clearing bit 7 of CRTC[17]. */
   2.267 -      outw(((regs[5+17] & 0x7F) << 8) | 17, 0x3d4);
   2.268 -      
   2.269 -      for ( i = 0; i < 25; i++ ) 
   2.270 +    
   2.271 +    /* Ensure CRTC registers 0-7 are unlocked by clearing bit 7 of CRTC[17]. */
   2.272 +    outw(((regs[5+17] & 0x7F) << 8) | 17, 0x3d4);
   2.273 +    
   2.274 +    for ( i = 0; i < 25; i++ ) 
   2.275          outw((regs[j++] << 8) | i, 0x3d4);
   2.276 -      
   2.277 -      for ( i = 0; i < 9;  i++ )
   2.278 +    
   2.279 +    for ( i = 0; i < 9;  i++ )
   2.280          outw((regs[j++] << 8) | i, 0x3ce);
   2.281 -      
   2.282 -      for ( i = 0; i < 21; i++ )
   2.283 -	{
   2.284 -	  tmp = inb(0x3da);
   2.285 -	  outb(i, 0x3c0); 
   2.286 -	  outb(regs[j++], 0x3c0);
   2.287 -	}
   2.288 -      
   2.289 -      tmp = inb(0x3da);
   2.290 -      outb(0x20, 0x3c0);
   2.291 +    
   2.292 +    for ( i = 0; i < 21; i++ )
   2.293 +    {
   2.294 +        tmp = inb(0x3da);
   2.295 +        outb(i, 0x3c0); 
   2.296 +        outb(regs[j++], 0x3c0);
   2.297      }
   2.298 -#endif
   2.299 +    
   2.300 +    tmp = inb(0x3da);
   2.301 +    outb(0x20, 0x3c0);
   2.302  }
   2.303  
   2.304  
   2.305  /* Clear the screen and initialize VIDEO, XPOS and YPOS.  */
   2.306  void cls(void)
   2.307  {
   2.308 -#ifdef CONFIG_OUTPUT_CONSOLE
   2.309      int i;
   2.310  
   2.311 -    if(opt_console) {
   2.312 -      video = (unsigned char *) VIDEO;
   2.313 -      
   2.314 -      for (i = 0; i < COLUMNS * LINES * 2; i++)
   2.315 +    if ( !opt_console )
   2.316 +        return;
   2.317 +
   2.318 +    video = (unsigned char *) VIDEO;
   2.319 +    
   2.320 +    for (i = 0; i < COLUMNS * LINES * 2; i++)
   2.321          *(video + i) = 0;
   2.322 -      
   2.323 -      xpos = 0;
   2.324 -      ypos = 0;
   2.325 -      
   2.326 -      outw(10+(1<<(5+8)), 0x3d4); /* cursor off */
   2.327 -    }
   2.328 -#endif
   2.329 +    
   2.330 +    xpos = 0;
   2.331 +    ypos = 0;
   2.332 +    
   2.333 +    outw(10+(1<<(5+8)), 0x3d4); /* cursor off */
   2.334  }
   2.335  
   2.336  
   2.337 -/* Put the character C on the screen.  */
   2.338 -static void putchar (int c)
   2.339 +static void put_newline(void)
   2.340 +{
   2.341 +    xpos = 0;
   2.342 +    ypos++;
   2.343 +
   2.344 +    if (ypos >= LINES)
   2.345 +    {
   2.346 +        static char zeroarr[2*COLUMNS] = { 0 };
   2.347 +        ypos = LINES-1;
   2.348 +        memcpy((char*)video, 
   2.349 +               (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS);
   2.350 +        memcpy((char*)video + (LINES-1)*2*COLUMNS, 
   2.351 +               zeroarr, 2*COLUMNS);
   2.352 +    }
   2.353 +}
   2.354 +
   2.355 +
   2.356 +void putchar_console(int c)
   2.357 +{
   2.358 +    if ( !opt_console )
   2.359 +        return;
   2.360 +
   2.361 +    if ( c == '\n' )
   2.362 +    {
   2.363 +        put_newline();
   2.364 +    }
   2.365 +    else
   2.366 +    {
   2.367 +        *(video + (xpos + ypos * COLUMNS) * 2) = c & 0xFF;
   2.368 +        *(video + (xpos + ypos * COLUMNS) * 2 + 1) = ATTRIBUTE;
   2.369 +        
   2.370 +        xpos++;
   2.371 +        if (xpos >= COLUMNS)
   2.372 +            put_newline();
   2.373 +    }
   2.374 +}
   2.375 +
   2.376 +#else
   2.377 +
   2.378 +void init_vga(void) {}
   2.379 +void cls(void) {}
   2.380 +void putchar_console(int c) {}
   2.381 +
   2.382 +#endif
   2.383 +
   2.384 +
   2.385 +static void putchar(int c)
   2.386  {
   2.387      if ( (c != '\n') && ((c < 32) || (c > 126)) ) return;
   2.388      putchar_serial(c);
   2.389 -  
   2.390 -#ifdef CONFIG_OUTPUT_CONSOLE
   2.391 -    if(opt_console) {
   2.392 -      if (c == '\n')
   2.393 -	{
   2.394 -	newline:
   2.395 -	  xpos = 0;
   2.396 -	  ypos++;
   2.397 -	  if (ypos >= LINES)
   2.398 -	    {
   2.399 -	      static char zeroarr[2*COLUMNS] = { 0 };
   2.400 -	      ypos = LINES-1;
   2.401 -	      memcpy((char*)video, 
   2.402 -		     (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS);
   2.403 -	      memcpy((char*)video + (LINES-1)*2*COLUMNS, 
   2.404 -		     zeroarr, 2*COLUMNS);
   2.405 -	    }
   2.406 -	  return;
   2.407 -	}
   2.408 -      
   2.409 -      *(video + (xpos + ypos * COLUMNS) * 2) = c & 0xFF;
   2.410 -      *(video + (xpos + ypos * COLUMNS) * 2 + 1) = ATTRIBUTE;
   2.411 -      
   2.412 -      xpos++;
   2.413 -      if (xpos >= COLUMNS)
   2.414 -        goto newline;
   2.415 -    }
   2.416 -#endif
   2.417 +    putchar_console(c);
   2.418  }
   2.419  
   2.420 +
   2.421  static inline void __putstr(const char *str)
   2.422  {
   2.423      while ( *str ) putchar(*str++);
   2.424  }
   2.425  
   2.426 +
   2.427  void printf (const char *fmt, ...)
   2.428  {
   2.429      va_list args;
   2.430 @@ -404,6 +420,7 @@ void printf (const char *fmt, ...)
   2.431      spin_unlock_irqrestore(&console_lock, flags);
   2.432  }
   2.433  
   2.434 +
   2.435  void panic(const char *fmt, ...)
   2.436  {
   2.437      va_list args;
   2.438 @@ -431,6 +448,7 @@ void panic(const char *fmt, ...)
   2.439      machine_restart(0);
   2.440  }
   2.441  
   2.442 +
   2.443  /* No-op syscall. */
   2.444  asmlinkage long sys_ni_syscall(void)
   2.445  {
   2.446 @@ -462,11 +480,6 @@ unsigned short compute_cksum(unsigned sh
   2.447  }
   2.448  
   2.449  
   2.450 -
   2.451 -/* XXX SMH: below is rather vile; pulled in to allow network console */
   2.452 -
   2.453 -extern int netif_rx(struct sk_buff *); 
   2.454 -
   2.455  /*
   2.456   * Function written by ek247. Exports console output from all domains upwards 
   2.457   * to domain0, by stuffing it into a fake network packet.
   2.458 @@ -575,9 +588,35 @@ long do_console_write(char *str, unsigne
   2.459      return(0);
   2.460  }
   2.461  
   2.462 +
   2.463  void __out_of_line_bug(int line)
   2.464  {
   2.465      printk("kernel BUG in header file at line %d\n", line);
   2.466      BUG();
   2.467      for ( ; ; ) continue;
   2.468  }
   2.469 +
   2.470 +
   2.471 +/*
   2.472 + * GRAVEYARD
   2.473 + */
   2.474 +#if 0
   2.475 +    if ( (mbi->flags & (1<<6)) )
   2.476 +    {
   2.477 +        memory_map_t *mmap = (memory_map_t *)mbi->mmap_addr;
   2.478 +        struct e820entry *e820 = E820_MAP;
   2.479 +
   2.480 +        while ( (unsigned long)mmap < (mbi->mmap_addr + mbi->mmap_length) )
   2.481 +        {
   2.482 +            e820->addr_lo = mmap->base_addr_low;
   2.483 +            e820->addr_hi = mmap->base_addr_high;
   2.484 +            e820->size_lo = mmap->length_low;
   2.485 +            e820->size_hi = mmap->length_high;
   2.486 +            e820->type    = mmap->type;
   2.487 +            e820++;
   2.488 +            mmap = (memory_map_t *) 
   2.489 +                ((unsigned long)mmap + mmap->size + sizeof (mmap->size));
   2.490 +        }
   2.491 +    }
   2.492 +#endif
   2.493 +
     3.1 --- a/xen/include/xeno/console.h	Sun Aug 17 10:41:25 2003 +0000
     3.2 +++ b/xen/include/xeno/console.h	Tue Aug 19 21:27:44 2003 +0000
     3.3 @@ -1,33 +1,43 @@
     3.4 -// <xeno/console.h> - Xen header file concerning console access
     3.5 -// Copyright (c) 2003 James Scott, Intel Research Cambridge
     3.6 +/******************************************************************************
     3.7 + * xeno/console.h
     3.8 + * 
     3.9 + * Xen header file concerning console access.
    3.10 + * 
    3.11 + * Copyright (c) 2003 James Scott, Intel Research Cambridge
    3.12 + */
    3.13  
    3.14 -// ownership of console - current defaulting to dom0
    3.15 -// this is currently used to see who gets the PS/2 keyboard/mouse events
    3.16 +/*
    3.17 + * Ownership of console --- currently hardwired to dom0. This is used to see 
    3.18 + * who gets the PS/2 keyboard/mouse events
    3.19 + */
    3.20 +
    3.21  #define CONSOLE_ISOWNER(p) (p->domain == 0) 
    3.22 -#define CONSOLE_OWNER find_domain_by_id(0) 
    3.23 +#define CONSOLE_OWNER      (find_domain_by_id(0))
    3.24  
    3.25  
    3.26 -// Xen output redirection (in common/kernel.c!)
    3.27 -//
    3.28 -// This is coarsely done right now - 
    3.29 -//   a boot-time option for console output
    3.30 -//   a compile-time option for serial output
    3.31 -//
    3.32 -// Really, when starting up a guest os with console privilege, we should:
    3.33 -//  - reset the video to a known state
    3.34 -//  - stop sending characters (use global var opt_console)
    3.35 -//  - allow the guest os access to the video RAM area (instead of the coarse IOPL hack nowadays) and keyboard (see above)
    3.36 -// Similarly, when stopping that guest os, we should:
    3.37 -//  - stop allowing the guest os access to video RAM
    3.38 -//  - reset the video to a known state
    3.39 -//  - start sending it console output again (if we so desire)
    3.40 -//
    3.41 -// resetting the video to a known state has not been explored yet
    3.42 -// the notion of privileges for guest os's (e.g. console privilege) has not been explored yet
    3.43 -// so this will do for now
    3.44 +/*
    3.45 + * Xen output redirection (in common/kernel.c)
    3.46 + *
    3.47 + * This is coarsely done right now - 
    3.48 + *  - a boot-time option for console output
    3.49 + *  - a compile-time option for serial output and console output
    3.50 + *
    3.51 + * Really, when starting up a guest os with console privilege, we should:
    3.52 + *  - reset the video to a known state
    3.53 + *  - stop sending characters (clear 'opt_console')
    3.54 + *  - allow the guest os access to the video RAM area and keyboard
    3.55 + * Similarly, when stopping that guest os, we should:
    3.56 + *  - stop allowing the guest os access to video RAM
    3.57 + *  - reset the video to a known state
    3.58 + *  - start sending it console output again (if we so desire)
    3.59 + *
    3.60 + * Resetting the video to a known state has not been explored yet, although
    3.61 + * Xen resets to a VGA text mode at start of day. Also, the notion of
    3.62 + * privileges for guest os's (e.g. console privilege) has not been explored
    3.63 + * yet, so this will do for now.
    3.64 + */
    3.65  
    3.66 -#define CONFIG_OUTPUT_CONSOLE 1 //  XXX You need to undef this
    3.67 -				//  but see also opt_console
    3.68 +#define CONFIG_OUTPUT_CONSOLE 1
    3.69  #define CONFIG_OUTPUT_SERIAL  1
    3.70  
    3.71 -extern unsigned int opt_console;
    3.72 +extern int opt_console;