ia64/xen-unstable

changeset 415:3ad4b311771f

bitkeeper revision 1.192.1.1 (3eb16618C2ePfMjC3p2SoqAYtLR0Kw)

Console support - next delta
author jws@cairnwell.research
date Thu May 01 18:23:20 2003 +0000 (2003-05-01)
parents 3ac10ab82d37
children 34407efa21dc
files .rootkeys xen/common/domain.c xen/common/kernel.c xen/drivers/char/xen_kbd.c xen/include/hypervisor-ifs/hypervisor-if.h xen/include/xeno/console.h xenolinux-2.4.21-pre4-sparse/arch/xeno/defconfig xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/Makefile xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/console.c xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c xenolinux-2.4.21-pre4-sparse/drivers/char/Config.in xenolinux-2.4.21-pre4-sparse/drivers/char/Makefile xenolinux-2.4.21-pre4-sparse/drivers/char/tty_io.c
line diff
     1.1 --- a/.rootkeys	Tue Apr 29 10:15:57 2003 +0000
     1.2 +++ b/.rootkeys	Thu May 01 18:23:20 2003 +0000
     1.3 @@ -297,6 +297,7 @@ 3ddb79c1pwmlw8VXW8aaSKAVGVmjDA xen/inclu
     1.4  3ddb79c0c0cX_DZE209-Bb-Rx1v-Aw xen/include/xeno/cache.h
     1.5  3e9c248aEG_nCngztiFmv5CfayNkcA xen/include/xeno/cdrom.h
     1.6  3ddb79c259jh8hE7vre_8NuE7nwNSA xen/include/xeno/config.h
     1.7 +3eb165e0eawr3R-p2ZQtSdLWtLRN_A xen/include/xeno/console.h
     1.8  3ddb79c1V44RD26YqCUm-kqIupM37A xen/include/xeno/ctype.h
     1.9  3ddb79c05DdHQ0UxX_jKsXdR4QlMCA xen/include/xeno/delay.h
    1.10  3ddb79c2PMeWTK86y4C3F4MzHw4A1g xen/include/xeno/dom0_ops.h
    1.11 @@ -415,7 +416,6 @@ 3e5a4e668yELUdtr3HiJZBIqxqUyuA xenolinux
    1.12  3ea53c6em6uzVHSiGqrbbAVofyRY_g xenolinux-2.4.21-pre4-sparse/drivers/block/genhd.c
    1.13  3e5a4e66mrtlmV75L1tjKDg8RaM5gA xenolinux-2.4.21-pre4-sparse/drivers/block/ll_rw_blk.c
    1.14  3ead095dEkj9JJWYYBnbvW3OYbKFxg xenolinux-2.4.21-pre4-sparse/drivers/char/Config.in
    1.15 -3ead095d00j61GCBaYdu_SwmY-vdSQ xenolinux-2.4.21-pre4-sparse/drivers/char/Makefile
    1.16  3ead095dPseRoFELVf_xcnVXjq02hw xenolinux-2.4.21-pre4-sparse/drivers/char/dummy_console.c
    1.17  3e5a4e66rw65CxyolW9PKz4GG42RcA xenolinux-2.4.21-pre4-sparse/drivers/char/tty_io.c
    1.18  3e5a4e669uzIE54VwucPYtGwXLAbzA xenolinux-2.4.21-pre4-sparse/fs/exec.c
     2.1 --- a/xen/common/domain.c	Tue Apr 29 10:15:57 2003 +0000
     2.2 +++ b/xen/common/domain.c	Thu May 01 18:23:20 2003 +0000
     2.3 @@ -15,6 +15,7 @@
     2.4  #include <asm/flushtlb.h>
     2.5  #include <asm/msr.h>
     2.6  #include <xeno/blkdev.h>
     2.7 +#include <xeno/console.h>
     2.8  
     2.9  /*
    2.10   * NB. No ring-3 access in initial guestOS pagetables. Note that we allow
    2.11 @@ -623,6 +624,11 @@ int setup_guestos(struct task_struct *p,
    2.12  
    2.13      virt_startinfo_address->dom_id = p->domain;
    2.14      virt_startinfo_address->flags  = IS_PRIV(p) ? SIF_PRIVILEGED : 0;
    2.15 +    // guest os can have console if:
    2.16 +    // 1) its privileged (need iopl right now)
    2.17 +    // 2) its the owner of the console (and therefore will get kbd/mouse events)
    2.18 +    // 3) xen hasnt tried to touch the console (see console.h)
    2.19 +    virt_startinfo_address->flags |= (IS_PRIV(p) && CONSOLE_ISOWNER(p) && opt_console == 0) ? SIF_CONSOLE : 0;
    2.20  
    2.21      if ( initrd_len )
    2.22      {
     3.1 --- a/xen/common/kernel.c	Tue Apr 29 10:15:57 2003 +0000
     3.2 +++ b/xen/common/kernel.c	Thu May 01 18:23:20 2003 +0000
     3.3 @@ -15,6 +15,7 @@
     3.4  #include <asm/byteorder.h>
     3.5  #include <linux/if_ether.h>
     3.6  #include <asm/domain_page.h>
     3.7 +#include <xeno/console.h>
     3.8  
     3.9  static int xpos, ypos;
    3.10  static volatile unsigned char *video;
    3.11 @@ -32,6 +33,7 @@ void init_serial(void);
    3.12  void start_of_day(void);
    3.13  
    3.14  /* Command line options and variables. */
    3.15 +int opt_console = 1;
    3.16  unsigned int opt_ser_baud = 9600;  /* default baud for COM1 */
    3.17  unsigned int opt_dom0_mem = 16000; /* default kbytes for DOM0 */
    3.18  unsigned int opt_ne_base = 0; /* NE2k NICs cannot be probed */
    3.19 @@ -43,6 +45,7 @@ static struct {
    3.20      int type;
    3.21      void *var;
    3.22  } opts[] = {
    3.23 +    { "console",  OPT_BOOL, &opt_console },
    3.24      { "ser_baud", OPT_UINT, &opt_ser_baud },
    3.25      { "dom0_mem", OPT_UINT, &opt_dom0_mem }, 
    3.26      { "ne_base",  OPT_UINT, &opt_ne_base },
    3.27 @@ -219,6 +222,7 @@ void cmain (unsigned long magic, multibo
    3.28  
    3.29  void init_serial(void)
    3.30  {
    3.31 +#ifdef CONFIG_OUTPUT_SERIAL
    3.32      /* 'opt_ser_baud' baud, no parity, 1 stop bit, 8 data bits. */
    3.33      outb(0x83, SERIAL_BASE+DATA_FORMAT);
    3.34      outb(115200/opt_ser_baud, SERIAL_BASE+DIVISOR_LO);
    3.35 @@ -227,15 +231,18 @@ void init_serial(void)
    3.36  
    3.37      /* No interrupts. */
    3.38      outb(0x00, SERIAL_BASE+INT_ENABLE);
    3.39 +#endif
    3.40  }
    3.41  
    3.42  
    3.43  void putchar_serial(unsigned char c)
    3.44  {
    3.45 +#ifdef CONFIG_OUTPUT_SERIAL
    3.46      if ( c == '\n' ) putchar_serial('\r');
    3.47      if ( (c != '\n') && (c != '\r') && ((c < 32) || (c > 126)) ) return;
    3.48      while ( !(inb(SERIAL_BASE+LINE_STATUS)&(1<<5)) ) barrier();
    3.49      outb(c, SERIAL_BASE+TX_HOLD);
    3.50 +#endif
    3.51  }
    3.52  
    3.53  
    3.54 @@ -248,6 +255,7 @@ void putchar_serial(unsigned char c)
    3.55  /* This is actually code from vgaHWRestore in an old version of XFree86 :-) */
    3.56  void init_vga(void)
    3.57  {
    3.58 +#ifdef CONFIG_OUTPUT_CONSOLE
    3.59      /* The following VGA state was saved from a chip in text mode 3. */
    3.60      static unsigned char regs[] = {
    3.61          /* Sequencer registers */
    3.62 @@ -266,79 +274,92 @@ void init_vga(void)
    3.63      int i, j = 0;
    3.64      volatile unsigned char tmp;
    3.65  
    3.66 -    tmp = inb(0x3da);
    3.67 -    outb(0x00, 0x3c0);
    3.68 -
    3.69 -    for ( i = 0; i < 5;  i++ )
    3.70 +    if(opt_console) {
    3.71 +      tmp = inb(0x3da);
    3.72 +      outb(0x00, 0x3c0);
    3.73 +      
    3.74 +      for ( i = 0; i < 5;  i++ )
    3.75          outw((regs[j++] << 8) | i, 0x3c4);
    3.76 -  
    3.77 -    /* Ensure CRTC registers 0-7 are unlocked by clearing bit 7 of CRTC[17]. */
    3.78 -    outw(((regs[5+17] & 0x7F) << 8) | 17, 0x3d4);
    3.79 -    
    3.80 -    for ( i = 0; i < 25; i++ ) 
    3.81 +      
    3.82 +      /* Ensure CRTC registers 0-7 are unlocked by clearing bit 7 of CRTC[17]. */
    3.83 +      outw(((regs[5+17] & 0x7F) << 8) | 17, 0x3d4);
    3.84 +      
    3.85 +      for ( i = 0; i < 25; i++ ) 
    3.86          outw((regs[j++] << 8) | i, 0x3d4);
    3.87 -    
    3.88 -    for ( i = 0; i < 9;  i++ )
    3.89 +      
    3.90 +      for ( i = 0; i < 9;  i++ )
    3.91          outw((regs[j++] << 8) | i, 0x3ce);
    3.92 -    
    3.93 -    for ( i = 0; i < 21; i++ )
    3.94 -    {
    3.95 -        tmp = inb(0x3da);
    3.96 -        outb(i, 0x3c0); 
    3.97 -        outb(regs[j++], 0x3c0);
    3.98 +      
    3.99 +      for ( i = 0; i < 21; i++ )
   3.100 +	{
   3.101 +	  tmp = inb(0x3da);
   3.102 +	  outb(i, 0x3c0); 
   3.103 +	  outb(regs[j++], 0x3c0);
   3.104 +	}
   3.105 +      
   3.106 +      tmp = inb(0x3da);
   3.107 +      outb(0x20, 0x3c0);
   3.108      }
   3.109 -
   3.110 -    tmp = inb(0x3da);
   3.111 -    outb(0x20, 0x3c0);
   3.112 +#endif
   3.113  }
   3.114  
   3.115  
   3.116  /* Clear the screen and initialize VIDEO, XPOS and YPOS.  */
   3.117  void cls(void)
   3.118  {
   3.119 +#ifdef CONFIG_OUTPUT_CONSOLE
   3.120      int i;
   3.121  
   3.122 -    video = (unsigned char *) VIDEO;
   3.123 -  
   3.124 -    for (i = 0; i < COLUMNS * LINES * 2; i++)
   3.125 +    if(opt_console) {
   3.126 +      video = (unsigned char *) VIDEO;
   3.127 +      
   3.128 +      for (i = 0; i < COLUMNS * LINES * 2; i++)
   3.129          *(video + i) = 0;
   3.130 -
   3.131 -    xpos = 0;
   3.132 -    ypos = 0;
   3.133 -
   3.134 -    outw(10+(1<<(5+8)), 0x3d4); /* cursor off */
   3.135 +      
   3.136 +      xpos = 0;
   3.137 +      ypos = 0;
   3.138 +      
   3.139 +      outw(10+(1<<(5+8)), 0x3d4); /* cursor off */
   3.140 +    }
   3.141 +#endif
   3.142  }
   3.143  
   3.144  
   3.145  /* Put the character C on the screen.  */
   3.146  static void putchar (int c)
   3.147  {
   3.148 +#ifdef CONFIG_OUTPUT_CONSOLE
   3.149      static char zeroarr[2*COLUMNS] = { 0 };
   3.150 +#endif
   3.151  
   3.152      putchar_serial(c);
   3.153  
   3.154 -    if (c == '\n' || c == '\r')
   3.155 -    {
   3.156 -    newline:
   3.157 -        xpos = 0;
   3.158 -        ypos++;
   3.159 -        if (ypos >= LINES)
   3.160 -        {
   3.161 -            ypos = LINES-1;
   3.162 -            memcpy((char*)video, 
   3.163 -                   (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS);
   3.164 -            memcpy((char*)video + (LINES-1)*2*COLUMNS, 
   3.165 -                   zeroarr, 2*COLUMNS);
   3.166 -        }
   3.167 -        return;
   3.168 +#ifdef CONFIG_OUTPUT_CONSOLE
   3.169 +    if(opt_console) {
   3.170 +      if (c == '\n' || c == '\r')
   3.171 +	{
   3.172 +	newline:
   3.173 +	  xpos = 0;
   3.174 +	  ypos++;
   3.175 +	  if (ypos >= LINES)
   3.176 +	    {
   3.177 +	      ypos = LINES-1;
   3.178 +	      memcpy((char*)video, 
   3.179 +		     (char*)video + 2*COLUMNS, (LINES-1)*2*COLUMNS);
   3.180 +	      memcpy((char*)video + (LINES-1)*2*COLUMNS, 
   3.181 +		     zeroarr, 2*COLUMNS);
   3.182 +	    }
   3.183 +	  return;
   3.184 +	}
   3.185 +      
   3.186 +      *(video + (xpos + ypos * COLUMNS) * 2) = c & 0xFF;
   3.187 +      *(video + (xpos + ypos * COLUMNS) * 2 + 1) = ATTRIBUTE;
   3.188 +      
   3.189 +      xpos++;
   3.190 +      if (xpos >= COLUMNS)
   3.191 +        goto newline;
   3.192      }
   3.193 -
   3.194 -    *(video + (xpos + ypos * COLUMNS) * 2) = c & 0xFF;
   3.195 -    *(video + (xpos + ypos * COLUMNS) * 2 + 1) = ATTRIBUTE;
   3.196 -
   3.197 -    xpos++;
   3.198 -    if (xpos >= COLUMNS)
   3.199 -        goto newline;
   3.200 +#endif
   3.201  }
   3.202  
   3.203  static inline void __putstr(const char *str)
     4.1 --- a/xen/drivers/char/xen_kbd.c	Tue Apr 29 10:15:57 2003 +0000
     4.2 +++ b/xen/drivers/char/xen_kbd.c	Thu May 01 18:23:20 2003 +0000
     4.3 @@ -31,10 +31,12 @@
     4.4  
     4.5  #define AUX_IRQ 12
     4.6  
     4.7 +#undef KBD_DEBUG
     4.8  
     4.9  /* THIS SECTION DEALS WITH CONFIG_XEN_ATTENTION_KEY */
    4.10  
    4.11 -// always set for now.  potentially moved to config.in later.
    4.12 +// always set for now.  potentially moved to a central config later.
    4.13 +// this should really affect common/keyhandler.c too
    4.14  #define CONFIG_XEN_ATTENTION_KEY
    4.15  
    4.16  #ifdef CONFIG_XEN_ATTENTION_KEY
    4.17 @@ -43,8 +45,6 @@ static int xen_attention_key_down = 0;
    4.18  #define XEN_ATTENTION_KEY 0x46 // scroll lock
    4.19  #define KBD_SCANCODE_KEYUP_MASK 0x80
    4.20  
    4.21 -#undef KBD_DEBUG
    4.22 -
    4.23  /* naive scancode -> key mappings for internal xen use */
    4.24  
    4.25  static unsigned char keymap_normal[] =
    4.26 @@ -144,7 +144,7 @@ static unsigned char convert_scancode (u
    4.27  #endif /* CONFIG_XEN_ATTENTION_KEY */
    4.28  
    4.29  
    4.30 -/* THIS SECTION DEALS WITH STORING A RING OF PENDING EVENTS */
    4.31 +/* THIS SECTION DEALS WITH STORING A RING OF PENDING KBD EVENTS */
    4.32  
    4.33  // store kbd events waiting to be processed by guest os
    4.34  #define KBD_RING_SIZE        64 
    4.35 @@ -179,9 +179,7 @@ static int kbd_ring_pop() {
    4.36  
    4.37  /* THIS SECTION DEALS WITH COMMUNICATING PS2 EVENTS/CMDS WITH GUEST OS */
    4.38  
    4.39 -// ownership of keyboard - current defaulting to dom0
    4.40 -#define KBD_ISOWNER(p) (p->domain == 0) 
    4.41 -#define KBD_OWNER find_domain_by_id(0) 
    4.42 +#include <xeno/console.h>
    4.43  
    4.44  // need lock as there may be _two_ interrupts at play, keyboard and mouse, as well as guest os actions
    4.45  static spinlock_t kbd_lock;
    4.46 @@ -194,7 +192,7 @@ long do_kbd_op(unsigned char op, unsigne
    4.47    printk("do_kbd_op: op %2x, val %2x, prod %d, cons %d\n", op, val, kbd_ring_prod, kbd_ring_cons); 
    4.48  #endif
    4.49  
    4.50 -  if ( !KBD_ISOWNER(current) ) return -EPERM;  
    4.51 +  if ( !CONSOLE_ISOWNER(current) ) return -EPERM;  
    4.52  
    4.53    switch(op) {
    4.54    case KBD_OP_WRITEOUTPUT:
    4.55 @@ -225,6 +223,7 @@ static void keyboard_interrupt(int irq, 
    4.56    unsigned long flags;
    4.57    spin_lock_irqsave(&kbd_lock, flags);
    4.58    status = kbd_read_status();
    4.59 +
    4.60  #ifdef KBD_DEBUG
    4.61      printk("keyboard_interrupt irq %d, status 0x%2x\n", irq, status);
    4.62  #endif
    4.63 @@ -241,10 +240,14 @@ static void keyboard_interrupt(int irq, 
    4.64  	  //printk("xen_attention_key_down %d\n", xen_attention_key_down);
    4.65  	} else if (xen_attention_key_down) {
    4.66  	  key_handler *handler; 
    4.67 -	  unsigned char key = convert_scancode(scancode); 
    4.68 +	  unsigned char key;
    4.69 +
    4.70 +	  spin_unlock_irqrestore(&kbd_lock, flags);
    4.71 +	  key = convert_scancode(scancode); 
    4.72  	  if(key && (handler = get_key_handler(key))) 
    4.73  	    (*handler)(key, dev_id, regs); 
    4.74  	  
    4.75 +	  spin_lock_irqsave(&kbd_lock, flags);
    4.76  	  status = kbd_read_status();
    4.77  	  continue; // do not send key to guest os
    4.78  	}
    4.79 @@ -254,11 +257,11 @@ static void keyboard_interrupt(int irq, 
    4.80        if (!(status & (KBD_STAT_GTO | KBD_STAT_PERR))) {
    4.81  	kbd_ring_push(status, scancode);
    4.82  
    4.83 -	cpu_mask = mark_guest_event(KBD_OWNER, _EVENT_KBD);
    4.84 +	cpu_mask = mark_guest_event(CONSOLE_OWNER, _EVENT_KBD);
    4.85          guest_event_notify(cpu_mask);
    4.86  
    4.87  	status = kbd_read_status();
    4.88 -	scancode = kbd_read_input();
    4.89 +	//scancode = kbd_read_input();
    4.90        }
    4.91      }
    4.92      
     5.1 --- a/xen/include/hypervisor-ifs/hypervisor-if.h	Tue Apr 29 10:15:57 2003 +0000
     5.2 +++ b/xen/include/hypervisor-ifs/hypervisor-if.h	Thu May 01 18:23:20 2003 +0000
     5.3 @@ -249,7 +249,8 @@ typedef struct start_info_st {
     5.4  } start_info_t;
     5.5  
     5.6  /* These flags are passed in the 'flags' field of start_info_t. */
     5.7 -#define SIF_PRIVILEGED 1          /* Is thie domain privileged? */
     5.8 +#define SIF_PRIVILEGED 1          /* Is the domain privileged? */
     5.9 +#define SIF_CONSOLE    2          /* Does the domain own the physical console? */
    5.10  
    5.11  /* For use in guest OSes. */
    5.12  extern shared_info_t *HYPERVISOR_shared_info;
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/xen/include/xeno/console.h	Thu May 01 18:23:20 2003 +0000
     6.3 @@ -0,0 +1,32 @@
     6.4 +// <xeno/console.h> - Xen header file concerning console access
     6.5 +// Copyright (c) 2003 James Scott, Intel Research Cambridge
     6.6 +
     6.7 +// ownership of console - current defaulting to dom0
     6.8 +// this is currently used to see who gets the PS/2 keyboard/mouse events
     6.9 +#define CONSOLE_ISOWNER(p) (p->domain == 0) 
    6.10 +#define CONSOLE_OWNER find_domain_by_id(0) 
    6.11 +
    6.12 +
    6.13 +// Xen output redirection (in common/kernel.c!)
    6.14 +//
    6.15 +// This is coarsely done right now - 
    6.16 +//   a boot-time option for console output
    6.17 +//   a compile-time option for serial output
    6.18 +//
    6.19 +// Really, when starting up a guest os with console privilege, we should:
    6.20 +//  - reset the video to a known state
    6.21 +//  - stop sending characters (use global var opt_console)
    6.22 +//  - allow the guest os access to the video RAM area (instead of the coarse IOPL hack nowadays) and keyboard (see above)
    6.23 +// Similarly, when stopping that guest os, we should:
    6.24 +//  - stop allowing the guest os access to video RAM
    6.25 +//  - reset the video to a known state
    6.26 +//  - start sending it console output again (if we so desire)
    6.27 +//
    6.28 +// resetting the video to a known state has not been explored yet
    6.29 +// the notion of privileges for guest os's (e.g. console privilege) has not been explored yet
    6.30 +// so this will do for now
    6.31 +
    6.32 +#define CONFIG_OUTPUT_CONSOLE 1 // but see also opt_console
    6.33 +#define CONFIG_OUTPUT_SERIAL  1
    6.34 +
    6.35 +extern int opt_console;
     7.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/defconfig	Tue Apr 29 10:15:57 2003 +0000
     7.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/defconfig	Thu May 01 18:23:20 2003 +0000
     7.3 @@ -125,9 +125,11 @@ CONFIG_XENOLINUX_BLOCK=y
     7.4  #
     7.5  # Character devices
     7.6  #
     7.7 +CONFIG_XEN_CONSOLE=y
     7.8  # CONFIG_VT is not set
     7.9 +# CONFIG_VGA_CONSOLE is not set
    7.10  # CONFIG_DUMMY_CONSOLE is not set
    7.11 -CONFIG_PSMOUSE=y
    7.12 +# CONFIG_PSMOUSE is not set
    7.13  # CONFIG_UNIX98_PTYS is not set
    7.14  
    7.15  #
     8.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/Makefile	Tue Apr 29 10:15:57 2003 +0000
     8.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/Makefile	Thu May 01 18:23:20 2003 +0000
     8.3 @@ -1,3 +1,3 @@
     8.4  O_TARGET := con.o
     8.5 -obj-y := console.o
     8.6 +obj-$(CONFIG_XEN_CONSOLE) := console.o
     8.7  include $(TOPDIR)/Rules.make
     9.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/console.c	Tue Apr 29 10:15:57 2003 +0000
     9.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/console/console.c	Thu May 01 18:23:20 2003 +0000
     9.3 @@ -24,9 +24,11 @@
     9.4  #include <asm/uaccess.h>
     9.5  #include <asm/hypervisor.h>
     9.6  
     9.7 +#define XENO_TTY_MINOR 123
     9.8 +
     9.9  /******************** Kernel console driver ********************************/
    9.10  
    9.11 -static void kconsole_write(struct console *co, const char *s, unsigned count)
    9.12 +static void xen_console_write(struct console *co, const char *s, unsigned count)
    9.13  {
    9.14  #define STRLEN 256
    9.15      static char str[STRLEN];
    9.16 @@ -49,56 +51,57 @@ static void kconsole_write(struct consol
    9.17      }
    9.18  }
    9.19  
    9.20 -static kdev_t kconsole_device(struct console *c)
    9.21 +static kdev_t xen_console_device(struct console *c)
    9.22  {
    9.23      /*
    9.24       * This is the magic that binds our "struct console" to our
    9.25       * "tty_struct", defined below.
    9.26       */
    9.27 -    return MKDEV(TTY_MAJOR, 0);
    9.28 +    return MKDEV(TTY_MAJOR, XENO_TTY_MINOR);
    9.29  }
    9.30  
    9.31 -static struct console kconsole_info = {
    9.32 -    name:		"xenocon",
    9.33 -    write:		kconsole_write,
    9.34 -    device:             kconsole_device,
    9.35 +static struct console xen_console_info = {
    9.36 +    name:		"xen_console",
    9.37 +    write:		xen_console_write,
    9.38 +    device:             xen_console_device,
    9.39      flags:		CON_PRINTBUFFER,
    9.40      index:		-1,
    9.41  };
    9.42  
    9.43 -void xeno_console_init(void)
    9.44 +void xen_console_init(void)
    9.45  {
    9.46 -    register_console(&kconsole_info);
    9.47 +  printk("xeno_console_init\n");
    9.48 +  register_console(&xen_console_info);
    9.49  }
    9.50  
    9.51  
    9.52  /******************** Initial /dev/console *********************************/
    9.53  
    9.54  
    9.55 -static struct tty_driver console_driver;
    9.56 -static int console_refcount;
    9.57 -static struct tty_struct *console_table[1];
    9.58 -static struct termios *console_termios[1];
    9.59 -static struct termios *console_termios_locked[1];
    9.60 +static struct tty_driver xeno_console_driver;
    9.61 +static int xeno_console_refcount;
    9.62 +static struct tty_struct *xeno_console_table[1];
    9.63 +static struct termios *xeno_console_termios[1];
    9.64 +static struct termios *xeno_console_termios_locked[1];
    9.65  
    9.66 -static int console_write_room(struct tty_struct *tty)
    9.67 +static int xeno_console_write_room(struct tty_struct *tty)
    9.68  {
    9.69      return INT_MAX;
    9.70  }
    9.71  
    9.72 -static int console_chars_in_buffer(struct tty_struct *tty)
    9.73 +static int xeno_console_chars_in_buffer(struct tty_struct *tty)
    9.74  {
    9.75      return 0;
    9.76  }
    9.77  
    9.78 -static inline int console_xmit(int ch)
    9.79 +static inline int xeno_console_xmit(int ch)
    9.80  {
    9.81      char _ch = ch;
    9.82 -    kconsole_write(NULL, &_ch, 1);
    9.83 +    xen_console_write(NULL, &_ch, 1);
    9.84      return 1;
    9.85  }
    9.86  
    9.87 -static int console_write(struct tty_struct *tty, int from_user,
    9.88 +static int xeno_console_write(struct tty_struct *tty, int from_user,
    9.89                         const u_char * buf, int count)
    9.90  {
    9.91      int i;
    9.92 @@ -119,17 +122,17 @@ static int console_write(struct tty_stru
    9.93          {
    9.94              ch = buf[i];
    9.95          }
    9.96 -        console_xmit(ch);
    9.97 +        xeno_console_xmit(ch);
    9.98      }
    9.99      return i;
   9.100  }
   9.101  
   9.102 -static void console_put_char(struct tty_struct *tty, u_char ch)
   9.103 +static void xeno_console_put_char(struct tty_struct *tty, u_char ch)
   9.104  {
   9.105 -    console_xmit(ch);
   9.106 +    xeno_console_xmit(ch);
   9.107  }
   9.108  
   9.109 -static int console_open(struct tty_struct *tty, struct file *filp)
   9.110 +static int xeno_console_open(struct tty_struct *tty, struct file *filp)
   9.111  {
   9.112      int line;
   9.113  
   9.114 @@ -146,37 +149,40 @@ static int console_open(struct tty_struc
   9.115      return 0;
   9.116  }
   9.117  
   9.118 -static void console_close(struct tty_struct *tty, struct file *filp)
   9.119 +static void xeno_console_close(struct tty_struct *tty, struct file *filp)
   9.120  {
   9.121      MOD_DEC_USE_COUNT;
   9.122  }
   9.123  
   9.124 -static int __init console_ini(void)
   9.125 +int __init xeno_con_init(void)
   9.126  {
   9.127 -    memset(&console_driver, 0, sizeof(struct tty_driver));
   9.128 -    console_driver.magic           = TTY_DRIVER_MAGIC;
   9.129 -    console_driver.driver_name     = "xeno_console";
   9.130 -    console_driver.name            = "console";
   9.131 -    console_driver.major           = TTY_MAJOR;
   9.132 -    console_driver.minor_start     = 0;
   9.133 -    console_driver.num             = 1;
   9.134 -    console_driver.type            = TTY_DRIVER_TYPE_SERIAL;
   9.135 -    console_driver.subtype         = SERIAL_TYPE_NORMAL;
   9.136 -    console_driver.init_termios    = tty_std_termios;
   9.137 -    console_driver.flags           = TTY_DRIVER_REAL_RAW;
   9.138 -    console_driver.refcount        = &console_refcount;
   9.139 -    console_driver.table           = console_table;
   9.140 -    console_driver.termios         = console_termios;
   9.141 -    console_driver.termios_locked  = console_termios_locked;
   9.142 +
   9.143 +    printk("xeno_con_init\n");
   9.144 +
   9.145 +    memset(&xeno_console_driver, 0, sizeof(struct tty_driver));
   9.146 +    xeno_console_driver.magic           = TTY_DRIVER_MAGIC;
   9.147 +    xeno_console_driver.driver_name     = "xeno_console";
   9.148 +    xeno_console_driver.name            = "xencon";
   9.149 +    xeno_console_driver.major           = TTY_MAJOR;
   9.150 +    xeno_console_driver.minor_start     = XENO_TTY_MINOR;
   9.151 +    xeno_console_driver.num             = 1;
   9.152 +    xeno_console_driver.type            = TTY_DRIVER_TYPE_SERIAL;
   9.153 +    xeno_console_driver.subtype         = SERIAL_TYPE_NORMAL;
   9.154 +    xeno_console_driver.init_termios    = tty_std_termios;
   9.155 +    xeno_console_driver.flags           = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
   9.156 +    xeno_console_driver.refcount        = &xeno_console_refcount;
   9.157 +    xeno_console_driver.table           = xeno_console_table;
   9.158 +    xeno_console_driver.termios         = xeno_console_termios;
   9.159 +    xeno_console_driver.termios_locked  = xeno_console_termios_locked;
   9.160      /* Functions */
   9.161 -    console_driver.open            = console_open;
   9.162 -    console_driver.close           = console_close;
   9.163 -    console_driver.write           = console_write;
   9.164 -    console_driver.write_room      = console_write_room;
   9.165 -    console_driver.put_char        = console_put_char;
   9.166 -    console_driver.chars_in_buffer = console_chars_in_buffer;
   9.167 +    xeno_console_driver.open            = xeno_console_open;
   9.168 +    xeno_console_driver.close           = xeno_console_close;
   9.169 +    xeno_console_driver.write           = xeno_console_write;
   9.170 +    xeno_console_driver.write_room      = xeno_console_write_room;
   9.171 +    xeno_console_driver.put_char        = xeno_console_put_char;
   9.172 +    xeno_console_driver.chars_in_buffer = xeno_console_chars_in_buffer;
   9.173  
   9.174 -    if ( tty_register_driver(&console_driver) )
   9.175 +    if ( tty_register_driver(&xeno_console_driver) )
   9.176      {
   9.177          printk(KERN_ERR "Couldn't register Xeno console driver\n");
   9.178      }
   9.179 @@ -188,17 +194,17 @@ static int __init console_ini(void)
   9.180      return 0;
   9.181  }
   9.182  
   9.183 -static void __exit console_fin(void)
   9.184 +void __exit xeno_con_fini(void)
   9.185  {
   9.186      int ret;
   9.187  
   9.188 -    ret = tty_unregister_driver(&console_driver);
   9.189 +    ret = tty_unregister_driver(&xeno_console_driver);
   9.190      if ( ret != 0 )
   9.191      {
   9.192          printk(KERN_ERR "Unable to unregister Xeno console driver: %d\n", ret);
   9.193      }
   9.194  }
   9.195  
   9.196 -module_init(console_ini);
   9.197 -module_exit(console_fin);
   9.198 +module_init(xeno_con_init);
   9.199 +module_exit(xeno_con_fini);
   9.200  
    10.1 --- a/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c	Tue Apr 29 10:15:57 2003 +0000
    10.2 +++ b/xenolinux-2.4.21-pre4-sparse/arch/xeno/kernel/setup.c	Thu May 01 18:23:20 2003 +0000
    10.3 @@ -163,8 +163,16 @@ void __init setup_arch(char **cmdline_p)
    10.4      ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
    10.5      memset(&drive_info, 0, sizeof(drive_info));
    10.6      memset(&screen_info, 0, sizeof(screen_info));
    10.7 +    // this is drawn from a dump from vgacon:startup in standard linux
    10.8 +    screen_info.orig_video_mode = 3; 
    10.9 +    screen_info.orig_video_isVGA = 1;
   10.10 +    screen_info.orig_video_lines = 25;
   10.11 +    screen_info.orig_video_cols = 80;
   10.12 +    screen_info.orig_video_ega_bx = 3;
   10.13 +    screen_info.orig_video_points = 16;
   10.14 +
   10.15      memset(&apm_info.bios, 0, sizeof(apm_info.bios));
   10.16 -    aux_device_present = 0;
   10.17 +    aux_device_present = 0; 
   10.18  #ifdef CONFIG_BLK_DEV_RAM
   10.19      rd_image_start = 0;
   10.20      rd_prompt = 0;
   10.21 @@ -292,6 +300,27 @@ void __init setup_arch(char **cmdline_p)
   10.22  #endif
   10.23  
   10.24      paging_init();
   10.25 +
   10.26 +    if(start_info.flags & SIF_PRIVILEGED) {
   10.27 +      // we are privileged guest os - should be able to set IOPL
   10.28 +      if(HYPERVISOR_iopl(1)) {
   10.29 +	panic("Unable to obtain IOPL, despite being SIF_PRIVILEGED");
   10.30 +      }
   10.31 +
   10.32 +    }
   10.33 +
   10.34 +    if(start_info.flags & SIF_CONSOLE) {
   10.35 +      if(!(start_info.flags & SIF_PRIVILEGED)) {
   10.36 +	panic("Xen granted us console access but not privileged status");
   10.37 +      }
   10.38 +#ifdef CONFIG_VT
   10.39 +#if defined(CONFIG_VGA_CONSOLE)
   10.40 +      conswitchp = &vga_con;
   10.41 +#elif defined(CONFIG_DUMMY_CONSOLE)
   10.42 +      conswitchp = &dummy_con;
   10.43 +#endif
   10.44 +#endif
   10.45 +    }
   10.46  }
   10.47  
   10.48  static int cachesize_override __initdata = -1;
    11.1 --- a/xenolinux-2.4.21-pre4-sparse/drivers/char/Config.in	Tue Apr 29 10:15:57 2003 +0000
    11.2 +++ b/xenolinux-2.4.21-pre4-sparse/drivers/char/Config.in	Thu May 01 18:23:20 2003 +0000
    11.3 @@ -4,18 +4,22 @@
    11.4  mainmenu_option next_comment
    11.5  comment 'Character devices'
    11.6  
    11.7 +bool 'Xen console support' CONFIG_XEN_CONSOLE
    11.8 +comment 'The options below are alpha-stage and will probably not work'
    11.9  bool 'Virtual terminal' CONFIG_VT
   11.10 -if [ "$CONFIG_VT" = "n" ]; then
   11.11 -   bool 'Dummy Console (to allow kbd/mouse testing without VTs)' CONFIG_DUMMY_CONSOLE
   11.12 -fi   
   11.13 -
   11.14 -bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE
   11.15 +if [ "$CONFIG_VT" = "y" ]; then
   11.16 +   bool '  Support for console on virtual terminal' CONFIG_VT_CONSOLE
   11.17 +   bool '  Support for VGA Video' CONFIG_VGA_CONSOLE
   11.18 +   bool '  Support for Dummy Video (for testing)' CONFIG_DUMMY_CONSOLE
   11.19 +   bool '  PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE
   11.20 +fi
   11.21  
   11.22  bool 'Unix98 PTY support' CONFIG_UNIX98_PTYS
   11.23  if [ "$CONFIG_UNIX98_PTYS" = "y" ]; then
   11.24     int 'Maximum number of Unix98 PTYs in use (0-2048)' CONFIG_UNIX98_PTY_COUNT 256
   11.25  fi
   11.26  
   11.27 +
   11.28  endmenu
   11.29  
   11.30  # KEPT IN CASE WE WANT TO BRING SOME BACK...
    12.1 --- a/xenolinux-2.4.21-pre4-sparse/drivers/char/Makefile	Tue Apr 29 10:15:57 2003 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,339 +0,0 @@
    12.4 -#
    12.5 -# Makefile for the kernel character device drivers.
    12.6 -#
    12.7 -# Note! Dependencies are done automagically by 'make dep', which also
    12.8 -# removes any old dependencies. DON'T put your own dependencies here
    12.9 -# unless it's something special (ie not a .c file).
   12.10 -#
   12.11 -# XENO INFO - this is just copied from the linux one
   12.12 -# and most is irrelevant for xenolinux and can go.
   12.13 -# (see Config.in for the relevant bits)
   12.14 -# JWS - added dummy_console to test ps2 functionality
   12.15 -
   12.16 -
   12.17 -#
   12.18 -# This file contains the font map for the default (hardware) font
   12.19 -#
   12.20 -FONTMAPFILE = cp437.uni
   12.21 -
   12.22 -O_TARGET := char.o
   12.23 -
   12.24 -obj-y	 += mem.o tty_io.o n_tty.o tty_ioctl.o raw.o pty.o misc.o random.o
   12.25 -
   12.26 -# All of the (potential) objects that export symbols.
   12.27 -# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
   12.28 -
   12.29 -export-objs     :=	busmouse.o console.o keyboard.o sysrq.o \
   12.30 -			misc.o pty.o random.o selection.o serial.o \
   12.31 -			sonypi.o tty_io.o tty_ioctl.o generic_serial.o \
   12.32 -			au1000_gpio.o hp_psaux.o nvram.o dummy_console.o
   12.33 -
   12.34 -mod-subdirs	:=	joystick ftape drm drm-4.0 pcmcia
   12.35 -
   12.36 -list-multi	:=	
   12.37 -
   12.38 -KEYMAP   =defkeymap.o
   12.39 -KEYBD    =pc_keyb.o
   12.40 -CONSOLE  =console.o
   12.41 -SERIAL   =serial.o
   12.42 -
   12.43 -ifeq ($(ARCH),s390)
   12.44 -  KEYMAP   =
   12.45 -  KEYBD    =
   12.46 -  CONSOLE  =
   12.47 -  SERIAL   =
   12.48 -endif
   12.49 -
   12.50 -ifeq ($(ARCH),mips)
   12.51 -  ifneq ($(CONFIG_PC_KEYB),y)
   12.52 -    KEYBD    =
   12.53 -  endif
   12.54 -endif
   12.55 -
   12.56 -ifeq ($(ARCH),s390x)
   12.57 -  KEYMAP   =
   12.58 -  KEYBD    =
   12.59 -  CONSOLE  =
   12.60 -  SERIAL   =
   12.61 -endif
   12.62 -
   12.63 -ifeq ($(ARCH),m68k)
   12.64 -   ifdef CONFIG_AMIGA
   12.65 -      KEYBD = amikeyb.o
   12.66 -   else
   12.67 -      ifndef CONFIG_MAC
   12.68 -	 KEYBD =
   12.69 -      endif
   12.70 -   endif
   12.71 -   SERIAL   =
   12.72 -endif
   12.73 -
   12.74 -ifeq ($(ARCH),parisc)
   12.75 -   ifdef CONFIG_GSC_PS2
   12.76 -      KEYBD   = hp_psaux.o hp_keyb.o
   12.77 -   else
   12.78 -      KEYBD   =
   12.79 -   endif
   12.80 -   ifdef CONFIG_SERIAL_MUX
   12.81 -      CONSOLE += mux.o
   12.82 -   endif
   12.83 -   ifdef CONFIG_PDC_CONSOLE
   12.84 -      CONSOLE += pdc_console.o
   12.85 -   endif
   12.86 -endif
   12.87 -
   12.88 -ifdef CONFIG_Q40
   12.89 -  KEYBD += q40_keyb.o
   12.90 -  SERIAL = serial.o
   12.91 -endif
   12.92 -
   12.93 -ifdef CONFIG_APOLLO
   12.94 -  KEYBD += dn_keyb.o
   12.95 -endif
   12.96 -
   12.97 -ifeq ($(ARCH),parisc)
   12.98 -   ifdef CONFIG_GSC_PS2
   12.99 -      KEYBD   = hp_psaux.o hp_keyb.o
  12.100 -   else
  12.101 -      KEYBD   =
  12.102 -   endif
  12.103 -   ifdef CONFIG_PDC_CONSOLE
  12.104 -      CONSOLE += pdc_console.o
  12.105 -   endif
  12.106 -endif
  12.107 -
  12.108 -ifeq ($(ARCH),arm)
  12.109 -  ifneq ($(CONFIG_PC_KEYMAP),y)
  12.110 -    KEYMAP   =
  12.111 -  endif
  12.112 -  ifneq ($(CONFIG_PC_KEYB),y)
  12.113 -    KEYBD    =
  12.114 -  endif
  12.115 -endif
  12.116 -
  12.117 -ifeq ($(ARCH),sh)
  12.118 -  KEYMAP   =
  12.119 -  KEYBD    =
  12.120 -  CONSOLE  =
  12.121 -  ifeq ($(CONFIG_SH_HP600),y)
  12.122 -  KEYMAP   = defkeymap.o
  12.123 -  KEYBD    = scan_keyb.o hp600_keyb.o
  12.124 -  CONSOLE  = console.o
  12.125 -  endif
  12.126 -  ifeq ($(CONFIG_SH_DMIDA),y)
  12.127 -  # DMIDA does not connect the HD64465 PS/2 keyboard port
  12.128 -  # but we allow for USB keyboards to be plugged in.
  12.129 -  KEYMAP   = defkeymap.o
  12.130 -  KEYBD    = # hd64465_keyb.o pc_keyb.o
  12.131 -  CONSOLE  = console.o
  12.132 -  endif
  12.133 -  ifeq ($(CONFIG_SH_EC3104),y)
  12.134 -  KEYMAP   = defkeymap.o
  12.135 -  KEYBD    = ec3104_keyb.o
  12.136 -  CONSOLE  = console.o
  12.137 -  endif
  12.138 -  ifeq ($(CONFIG_SH_DREAMCAST),y)
  12.139 -  KEYMAP   = defkeymap.o
  12.140 -  KEYBD    =
  12.141 -  CONSOLE  = console.o
  12.142 -  endif
  12.143 -endif
  12.144 -
  12.145 -ifeq ($(CONFIG_DECSTATION),y)
  12.146 -  KEYMAP   =
  12.147 -  KEYBD    =
  12.148 -  SERIAL   = decserial.o
  12.149 -endif
  12.150 -
  12.151 -ifeq ($(CONFIG_BAGET_MIPS),y)
  12.152 -  KEYBD    =
  12.153 -  SERIAL   =
  12.154 -endif
  12.155 -
  12.156 -ifeq ($(CONFIG_NINO),y)
  12.157 -  SERIAL   =
  12.158 -endif
  12.159 -
  12.160 -ifneq ($(CONFIG_SUN_SERIAL),)
  12.161 -  SERIAL   =
  12.162 -endif
  12.163 -
  12.164 -ifeq ($(CONFIG_QTRONIX_KEYBOARD),y)
  12.165 -  KEYBD    = qtronix.o
  12.166 -  KEYMAP   = qtronixmap.o
  12.167 -endif
  12.168 -
  12.169 -ifeq ($(CONFIG_DUMMY_KEYB),y)
  12.170 -  KEYBD = dummy_keyb.o
  12.171 -endif
  12.172 -
  12.173 -obj-$(CONFIG_VT) += vt.o vc_screen.o consolemap.o consolemap_deftbl.o $(CONSOLE) selection.o
  12.174 -
  12.175 -ifeq ($(CONFIG_VT),)
  12.176 -  obj-$(CONFIG_DUMMY_CONSOLE) += $(KEYBD) dummy_console.o
  12.177 -endif
  12.178 -
  12.179 -obj-$(CONFIG_SERIAL) += $(SERIAL)
  12.180 -obj-$(CONFIG_SERIAL_HCDP) += hcdp_serial.o
  12.181 -obj-$(CONFIG_SERIAL_21285) += serial_21285.o
  12.182 -obj-$(CONFIG_SERIAL_SA1100) += serial_sa1100.o
  12.183 -obj-$(CONFIG_SERIAL_AMBA) += serial_amba.o
  12.184 -obj-$(CONFIG_TS_AU1000_ADS7846) += au1000_ts.o
  12.185 -
  12.186 -ifndef CONFIG_SUN_KEYBOARD
  12.187 -  obj-$(CONFIG_VT) += keyboard.o $(KEYMAP) $(KEYBD)
  12.188 -else
  12.189 -  obj-$(CONFIG_PCI) += keyboard.o $(KEYMAP)
  12.190 -endif
  12.191 -
  12.192 -obj-$(CONFIG_HIL) += hp_keyb.o
  12.193 -obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
  12.194 -obj-$(CONFIG_ATARI_DSP56K) += dsp56k.o
  12.195 -obj-$(CONFIG_ROCKETPORT) += rocket.o
  12.196 -obj-$(CONFIG_MOXA_SMARTIO) += mxser.o
  12.197 -obj-$(CONFIG_MOXA_INTELLIO) += moxa.o
  12.198 -obj-$(CONFIG_DIGI) += pcxx.o
  12.199 -obj-$(CONFIG_DIGIEPCA) += epca.o
  12.200 -obj-$(CONFIG_CYCLADES) += cyclades.o
  12.201 -obj-$(CONFIG_STALLION) += stallion.o
  12.202 -obj-$(CONFIG_ISTALLION) += istallion.o
  12.203 -obj-$(CONFIG_SIBYTE_SB1250_DUART) += sb1250_duart.o
  12.204 -obj-$(CONFIG_COMPUTONE) += ip2.o ip2main.o
  12.205 -obj-$(CONFIG_RISCOM8) += riscom8.o
  12.206 -obj-$(CONFIG_ISI) += isicom.o
  12.207 -obj-$(CONFIG_ESPSERIAL) += esp.o
  12.208 -obj-$(CONFIG_SYNCLINK) += synclink.o
  12.209 -obj-$(CONFIG_SYNCLINKMP) += synclinkmp.o
  12.210 -obj-$(CONFIG_N_HDLC) += n_hdlc.o
  12.211 -obj-$(CONFIG_SPECIALIX) += specialix.o
  12.212 -obj-$(CONFIG_AMIGA_BUILTIN_SERIAL) += amiserial.o
  12.213 -obj-$(CONFIG_A2232) += ser_a2232.o generic_serial.o
  12.214 -obj-$(CONFIG_SX) += sx.o generic_serial.o
  12.215 -obj-$(CONFIG_RIO) += rio/rio.o generic_serial.o
  12.216 -obj-$(CONFIG_SH_SCI) += sh-sci.o generic_serial.o
  12.217 -obj-$(CONFIG_SERIAL167) += serial167.o
  12.218 -obj-$(CONFIG_MVME147_SCC) += generic_serial.o vme_scc.o
  12.219 -obj-$(CONFIG_MVME162_SCC) += generic_serial.o vme_scc.o
  12.220 -obj-$(CONFIG_BVME6000_SCC) += generic_serial.o vme_scc.o
  12.221 -obj-$(CONFIG_HVC_CONSOLE) += hvc_console.o
  12.222 -obj-$(CONFIG_SERIAL_TX3912) += generic_serial.o serial_tx3912.o
  12.223 -obj-$(CONFIG_TXX927_SERIAL) += serial_txx927.o
  12.224 -
  12.225 -subdir-$(CONFIG_RIO) += rio
  12.226 -subdir-$(CONFIG_INPUT) += joystick
  12.227 -
  12.228 -obj-$(CONFIG_ATIXL_BUSMOUSE) += atixlmouse.o
  12.229 -obj-$(CONFIG_LOGIBUSMOUSE) += logibusmouse.o
  12.230 -obj-$(CONFIG_PRINTER) += lp.o
  12.231 -obj-$(CONFIG_TIPAR) += tipar.o
  12.232 -
  12.233 -ifeq ($(CONFIG_INPUT),y)
  12.234 -obj-y += joystick/js.o
  12.235 -endif
  12.236 -
  12.237 -obj-$(CONFIG_BUSMOUSE) += busmouse.o
  12.238 -obj-$(CONFIG_DTLK) += dtlk.o
  12.239 -obj-$(CONFIG_R3964) += n_r3964.o
  12.240 -obj-$(CONFIG_APPLICOM) += applicom.o
  12.241 -obj-$(CONFIG_SONYPI) += sonypi.o
  12.242 -obj-$(CONFIG_MS_BUSMOUSE) += msbusmouse.o
  12.243 -obj-$(CONFIG_82C710_MOUSE) += qpmouse.o
  12.244 -obj-$(CONFIG_AMIGAMOUSE) += amigamouse.o
  12.245 -obj-$(CONFIG_ATARIMOUSE) += atarimouse.o
  12.246 -obj-$(CONFIG_ADBMOUSE) += adbmouse.o
  12.247 -obj-$(CONFIG_PC110_PAD) += pc110pad.o
  12.248 -obj-$(CONFIG_MK712_MOUSE) += mk712.o
  12.249 -obj-$(CONFIG_RTC) += rtc.o
  12.250 -obj-$(CONFIG_EFI_RTC) += efirtc.o
  12.251 -ifeq ($(CONFIG_PPC),)
  12.252 -  obj-$(CONFIG_NVRAM) += nvram.o
  12.253 -endif
  12.254 -obj-$(CONFIG_TOSHIBA) += toshiba.o
  12.255 -obj-$(CONFIG_I8K) += i8k.o
  12.256 -obj-$(CONFIG_DS1620) += ds1620.o
  12.257 -obj-$(CONFIG_INTEL_RNG) += i810_rng.o
  12.258 -obj-$(CONFIG_AMD_RNG) += amd768_rng.o
  12.259 -obj-$(CONFIG_AMD_PM768) += amd76x_pm.o
  12.260 -
  12.261 -obj-$(CONFIG_ITE_GPIO) += ite_gpio.o
  12.262 -obj-$(CONFIG_AU1000_GPIO) += au1000_gpio.o
  12.263 -obj-$(CONFIG_COBALT_LCD) += lcd.o
  12.264 -
  12.265 -obj-$(CONFIG_QIC02_TAPE) += tpqic02.o
  12.266 -
  12.267 -subdir-$(CONFIG_FTAPE) += ftape
  12.268 -subdir-$(CONFIG_DRM_OLD) += drm-4.0
  12.269 -subdir-$(CONFIG_DRM_NEW) += drm
  12.270 -subdir-$(CONFIG_PCMCIA) += pcmcia
  12.271 -subdir-$(CONFIG_AGP) += agp
  12.272 -
  12.273 -ifeq ($(CONFIG_FTAPE),y)
  12.274 -obj-y       += ftape/ftape.o
  12.275 -endif
  12.276 -
  12.277 -obj-$(CONFIG_H8) += h8.o
  12.278 -obj-$(CONFIG_PPDEV) += ppdev.o
  12.279 -obj-$(CONFIG_DZ) += dz.o
  12.280 -obj-$(CONFIG_NWBUTTON) += nwbutton.o
  12.281 -obj-$(CONFIG_NWFLASH) += nwflash.o
  12.282 -obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o scx200.o
  12.283 -
  12.284 -# Only one watchdog can succeed. We probe the hardware watchdog
  12.285 -# drivers first, then the softdog driver.  This means if your hardware
  12.286 -# watchdog dies or is 'borrowed' for some reason the software watchdog
  12.287 -# still gives you some cover.
  12.288 -
  12.289 -obj-$(CONFIG_PCWATCHDOG) += pcwd.o
  12.290 -obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
  12.291 -obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o
  12.292 -obj-$(CONFIG_IB700_WDT) += ib700wdt.o
  12.293 -obj-$(CONFIG_MIXCOMWD) += mixcomwd.o
  12.294 -obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
  12.295 -obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o
  12.296 -obj-$(CONFIG_SC520_WDT) += sc520_wdt.o
  12.297 -obj-$(CONFIG_WDT) += wdt.o
  12.298 -obj-$(CONFIG_WDTPCI) += wdt_pci.o
  12.299 -obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
  12.300 -obj-$(CONFIG_977_WATCHDOG) += wdt977.o
  12.301 -obj-$(CONFIG_I810_TCO) += i810-tco.o
  12.302 -obj-$(CONFIG_MACHZ_WDT) += machzwd.o
  12.303 -obj-$(CONFIG_SH_WDT) += shwdt.o
  12.304 -obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o
  12.305 -obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o
  12.306 -#obj-$(CONFIG_ALIM1535_WDT) += alim1535d_wdt.o
  12.307 -obj-$(CONFIG_INDYDOG) += indydog.o
  12.308 -obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o
  12.309 -obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
  12.310 -obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o
  12.311 -obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
  12.312 -obj-$(CONFIG_AMD7XX_TCO) += amd7xx_tco.o
  12.313 -
  12.314 -subdir-$(CONFIG_MWAVE) += mwave
  12.315 -ifeq ($(CONFIG_MWAVE),y)
  12.316 -  obj-y += mwave/mwave.o
  12.317 -endif
  12.318 -
  12.319 -subdir-$(CONFIG_IPMI_HANDLER) += ipmi
  12.320 -ifeq ($(CONFIG_IPMI_HANDLER),y)
  12.321 -  obj-y += ipmi/ipmi.o
  12.322 -endif
  12.323 -
  12.324 -include $(TOPDIR)/Rules.make
  12.325 -
  12.326 -fastdep:
  12.327 -
  12.328 -conmakehash: conmakehash.c
  12.329 -	$(HOSTCC) $(HOSTCFLAGS) -o conmakehash conmakehash.c
  12.330 -
  12.331 -consolemap_deftbl.c: $(FONTMAPFILE) conmakehash
  12.332 -	./conmakehash $(FONTMAPFILE) > consolemap_deftbl.c
  12.333 -
  12.334 -consolemap_deftbl.o: consolemap_deftbl.c $(TOPDIR)/include/linux/types.h
  12.335 -
  12.336 -.DELETE_ON_ERROR:
  12.337 -
  12.338 -defkeymap.c: defkeymap.map
  12.339 -	set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
  12.340 -
  12.341 -qtronixmap.c: qtronixmap.map
  12.342 -	set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@
    13.1 --- a/xenolinux-2.4.21-pre4-sparse/drivers/char/tty_io.c	Tue Apr 29 10:15:57 2003 +0000
    13.2 +++ b/xenolinux-2.4.21-pre4-sparse/drivers/char/tty_io.c	Thu May 01 18:23:20 2003 +0000
    13.3 @@ -102,8 +102,8 @@
    13.4  
    13.5  #include <linux/kmod.h>
    13.6  
    13.7 -#ifdef CONFIG_XENO
    13.8 -extern void xeno_console_init(void);
    13.9 +#ifdef CONFIG_XEN_CONSOLE
   13.10 +extern void xen_console_init(void);
   13.11  #endif
   13.12  
   13.13  #ifdef CONFIG_VT
   13.14 @@ -817,8 +817,9 @@ static int init_dev(kdev_t device, struc
   13.15  	int idx;
   13.16  
   13.17  	driver = get_tty_driver(device);
   13.18 -	if (!driver)
   13.19 -		return -ENODEV;
   13.20 +	if (!driver) {
   13.21 +	  return -ENODEV;
   13.22 +	}
   13.23  
   13.24  	idx = MINOR(device) - driver->minor_start;
   13.25  
   13.26 @@ -2186,7 +2187,7 @@ int tty_unregister_driver(struct tty_dri
   13.27   */
   13.28  void __init console_init(void)
   13.29  {
   13.30 -	/* Setup the default TTY line discipline. */
   13.31 +        /* Setup the default TTY line discipline. */
   13.32  	memset(ldiscs, 0, sizeof(ldiscs));
   13.33  	(void) tty_register_ldisc(N_TTY, &tty_ldisc_N_TTY);
   13.34  
   13.35 @@ -2209,9 +2210,14 @@ void __init console_init(void)
   13.36  #ifdef CONFIG_EARLY_PRINTK
   13.37  	disable_early_printk(); 
   13.38  #endif
   13.39 +
   13.40  #ifdef CONFIG_VT
   13.41  	con_init();
   13.42  #endif
   13.43 +
   13.44 +#ifdef CONFIG_XEN_CONSOLE
   13.45 +	xen_console_init();
   13.46 +#endif
   13.47  #ifdef CONFIG_AU1000_SERIAL_CONSOLE
   13.48  	au1000_serial_console_init();
   13.49  #endif
   13.50 @@ -2326,9 +2332,6 @@ void __init tty_init(void)
   13.51  	/* console calls tty_register_driver() before kmalloc() works.
   13.52  	 * Thus, we can't devfs_register() then.  Do so now, instead. 
   13.53  	 */
   13.54 -#ifdef CONFIG_XENO
   13.55 -        xeno_console_init();
   13.56 -#endif
   13.57  #ifdef CONFIG_VT
   13.58  	con_init_devfs();
   13.59  #endif
   13.60 @@ -2358,11 +2361,6 @@ void __init tty_init(void)
   13.61  		panic("Couldn't register /dev/tty0 driver\n");
   13.62  
   13.63  	kbd_init();
   13.64 -#else
   13.65 -	// the below is a dodgy hack to allow keyboard/mouse support without the console support, along with the file "dummy_console.c"
   13.66 -#ifdef CONFIG_DUMMY_CONSOLE
   13.67 -	kbd_init();
   13.68 -#endif
   13.69  #endif
   13.70  
   13.71  #ifdef CONFIG_ESPSERIAL  /* init ESP before rs, so rs doesn't see the port */