ia64/xen-unstable

changeset 760:c931874af648

bitkeeper revision 1.458 (3f6f7435Or79x1vh5ypTVbN9G7OJUg)

config.h, xen_serial.c, kernel.c, README.CD:
Allow serial I/O to be entirely disabled, and make this teh default. Enable by specifying a ser_baud during boot.
author kaf24@scramble.cl.cam.ac.uk
date Mon Sep 22 22:14:13 2003 +0000 (2003-09-22)
parents 977a79f98c2f
children 6c8e1df49bc7
files README.CD xen/common/kernel.c xen/drivers/char/xen_serial.c xen/include/xeno/config.h
line diff
     1.1 --- a/README.CD	Sun Sep 21 17:53:37 2003 +0000
     1.2 +++ b/README.CD	Mon Sep 22 22:14:13 2003 +0000
     1.3 @@ -45,13 +45,12 @@ Because of the demo CD's use of RAM disk
     1.4  of RAM (256MB+).
     1.5  
     1.6  To try out the Demo, boot from CD (you may need to change your BIOS
     1.7 -configuration to do this), hit a key on either the keyboard or serial
     1.8 -line to pull up the Grub boot menu, then select one of the four boot
     1.9 -options:
    1.10 +configuration to do this), then select one of the four boot options 
    1.11 +from the Grub menu:
    1.12  
    1.13   Xen / linux-2.4.22 
    1.14   Xen / linux-2.4.22 using cmdline IP configuration
    1.15 - Xen ? linux-2.4.22 in "safe mode"
    1.16 + Xen / linux-2.4.22 in "safe mode"
    1.17   linux-2.4.22
    1.18  
    1.19  The last option is a plain linux kernel that runs on the bare machine,
    1.20 @@ -77,9 +76,9 @@ sequentially for subsequent domains unle
    1.21  
    1.22  After selecting the kernel to boot, stand back and watch Xen boot,
    1.23  closely followed by "domain 0" running the XenoLinux kernel. The boot
    1.24 -messages are also sent to the serial line (the baud rate can be set on
    1.25 -the Xen cmdline, but defaults to 115200), which can be very useful for
    1.26 -debugging should anything important scroll off the screen. Xen's
    1.27 +messages can also sent to the serial line by specifying the baud rate
    1.28 +on the Xen cmdline (e.g., 'ser_baud=9600'); this can be very useful
    1.29 +for debugging should anything important scroll off the screen. Xen's
    1.30  startup messages will look quite familiar as much of the hardware
    1.31  initialisation (SMP boot, apic setup) and device drivers are derived
    1.32  from Linux.
    1.33 @@ -284,7 +283,7 @@ that may be able to help diagnose proble
    1.34  
    1.35   ifname=dummy	  Don't use any network interface.
    1.36  
    1.37 - ser_baud=xxx	  Set serial line baud rate for console.
    1.38 + ser_baud=xxx	  Enable serial I/O and set the baud rate.
    1.39  
    1.40   dom0_mem=xxx 	  Set the initial amount of memory for domain0.
    1.41  		  
    1.42 @@ -358,12 +357,12 @@ title Xen / XenoLinux 2.4.22
    1.43          module /boot/xenolinux.gz root=/dev/sda4 ro console=tty0
    1.44  
    1.45  The first line specifies which Xen image to use, and what command line
    1.46 -arguments to pass to Xen. In this case, we set the maximum amount of
    1.47 -memory to allocate to domain0, and the serial baud rate (the default
    1.48 -is 9600 baud). We could also disable smp support (nosmp) or disable
    1.49 -hyper-threading support (noht). If you have multiple network interface
    1.50 -you can use ifname=ethXX to select which one to use. If your network
    1.51 -card is unsupported, use ifname=dummy
    1.52 +arguments to pass to Xen. In this case we set the maximum amount of
    1.53 +memory to allocate to domain0, and enable serial I/O at 9600 baud.
    1.54 +We could also disable smp support (nosmp) or disable hyper-threading
    1.55 +support (noht). If you have multiple network interface you can use
    1.56 +ifname=ethXX to select which one to use. If your network card is
    1.57 +unsupported, use ifname=dummy
    1.58  
    1.59  The second line specifies which xenolinux image to use, and the
    1.60  standard linux command line arguments to pass to the kernel. In this
    1.61 @@ -416,8 +415,9 @@ Debugging
    1.62  ---------
    1.63  
    1.64  Xen has a set of debugging features that can be useful to try and
    1.65 -figure out what's going on. Hit 'h' on the serial line or ScrollLock-h
    1.66 -on the keyboard to get a list of supported commands. 
    1.67 +figure out what's going on. Hit 'h' on the serial line (if you
    1.68 +specified a baud rate on the Xen command line) or ScrollLock-h on the
    1.69 +keyboard to get a list of supported commands.
    1.70  
    1.71  If you have a crash you'll likely get a crash dump containing an EIP
    1.72  (PC) which, along with an 'objdump -d image', can be useful in
     2.1 --- a/xen/common/kernel.c	Sun Sep 21 17:53:37 2003 +0000
     2.2 +++ b/xen/common/kernel.c	Mon Sep 22 22:14:13 2003 +0000
     2.3 @@ -48,7 +48,8 @@ void start_of_day(void);
     2.4  /* opt_console: If true, Xen sends logging to the VGA console. */
     2.5  int opt_console = 1;
     2.6  /* opt_ser_baud: Baud rate at which logging is sent to COM1. */
     2.7 -unsigned int opt_ser_baud = 9600;
     2.8 +/* NB. Default (0) means that serial I/O is disabled. */
     2.9 +unsigned int opt_ser_baud = 0;
    2.10  /* opt_dom0_mem: Kilobytes of memory allocated to domain 0. */
    2.11  unsigned int opt_dom0_mem = 16000;
    2.12  /* opt_ifname: Name of physical network interface to use. */
    2.13 @@ -232,6 +233,9 @@ void cmain (unsigned long magic, multibo
    2.14  
    2.15  void init_serial(void)
    2.16  {
    2.17 +    if ( !SERIAL_ENABLED )
    2.18 +        return;
    2.19 +
    2.20      /* 'opt_ser_baud' baud, no parity, 1 stop bit, 8 data bits. */
    2.21      outb(0x83, SERIAL_BASE+DATA_FORMAT);
    2.22      outb(115200/opt_ser_baud, SERIAL_BASE+DIVISOR_LO);
    2.23 @@ -249,6 +253,8 @@ void init_serial(void)
    2.24  #ifdef CONFIG_OUTPUT_SERIAL
    2.25  void putchar_serial(unsigned char c)
    2.26  {
    2.27 +    if ( !SERIAL_ENABLED )
    2.28 +        return;
    2.29      if ( c == '\n' ) putchar_serial('\r');
    2.30      while ( !(inb(SERIAL_BASE+LINE_STATUS)&(1<<5)) ) barrier();
    2.31      outb(c, SERIAL_BASE+TX_HOLD);
     3.1 --- a/xen/drivers/char/xen_serial.c	Sun Sep 21 17:53:37 2003 +0000
     3.2 +++ b/xen/drivers/char/xen_serial.c	Mon Sep 22 22:14:13 2003 +0000
     3.3 @@ -71,6 +71,9 @@ static void serial_rx_int(int irq, void 
     3.4  void initialize_serial() 
     3.5  {
     3.6      int rc; 
     3.7 +
     3.8 +    if ( !SERIAL_ENABLED )
     3.9 +        return;
    3.10      
    3.11      /* setup key handler */
    3.12      add_key_handler('~', toggle_echo, "toggle serial echo");
     4.1 --- a/xen/include/xeno/config.h	Sun Sep 21 17:53:37 2003 +0000
     4.2 +++ b/xen/include/xeno/config.h	Mon Sep 22 22:14:13 2003 +0000
     4.3 @@ -146,9 +146,14 @@
     4.4  #define capable(_c) 0
     4.5  
     4.6  #ifndef __ASSEMBLY__
     4.7 +
     4.8  extern unsigned long _end; /* standard ELF symbol */
     4.9  extern void __out_of_line_bug(int line) __attribute__((noreturn));
    4.10  #define out_of_line_bug() __out_of_line_bug(__LINE__)
    4.11 -#endif
    4.12 +
    4.13 +extern unsigned int opt_ser_baud;
    4.14 +#define SERIAL_ENABLED (opt_ser_baud != 0)
    4.15 +
    4.16 +#endif /* __ASSEMBLY__ */
    4.17  
    4.18  #endif /* __XENO_CONFIG_H__ */