bitkeeper revision 1.458 (3f6f7435Or79x1vh5ypTVbN9G7OJUg)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 22 Sep 2003 22:14:13 +0000 (22:14 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 22 Sep 2003 22:14:13 +0000 (22:14 +0000)
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.

README.CD
xen/common/kernel.c
xen/drivers/char/xen_serial.c
xen/include/xeno/config.h

index 99f1ea170fc65876646e53b60c63fc47d1c0bb09..a6fc77c47b9de3aa5073ad8761f752f9f50a96a5 100644 (file)
--- a/README.CD
+++ b/README.CD
@@ -45,13 +45,12 @@ Because of the demo CD's use of RAM disks, make sure you have plenty
 of RAM (256MB+).
 
 To try out the Demo, boot from CD (you may need to change your BIOS
-configuration to do this), hit a key on either the keyboard or serial
-line to pull up the Grub boot menu, then select one of the four boot
-options:
+configuration to do this), then select one of the four boot options 
+from the Grub menu:
 
  Xen / linux-2.4.22 
  Xen / linux-2.4.22 using cmdline IP configuration
- Xen ? linux-2.4.22 in "safe mode"
+ Xen / linux-2.4.22 in "safe mode"
  linux-2.4.22
 
 The last option is a plain linux kernel that runs on the bare machine,
@@ -77,9 +76,9 @@ sequentially for subsequent domains unless told otherwise.
 
 After selecting the kernel to boot, stand back and watch Xen boot,
 closely followed by "domain 0" running the XenoLinux kernel. The boot
-messages are also sent to the serial line (the baud rate can be set on
-the Xen cmdline, but defaults to 115200), which can be very useful for
-debugging should anything important scroll off the screen. Xen's
+messages can also sent to the serial line by specifying the baud rate
+on the Xen cmdline (e.g., 'ser_baud=9600'); this can be very useful
+for debugging should anything important scroll off the screen. Xen's
 startup messages will look quite familiar as much of the hardware
 initialisation (SMP boot, apic setup) and device drivers are derived
 from Linux.
@@ -284,7 +283,7 @@ that may be able to help diagnose problems:
 
  ifname=dummy    Don't use any network interface.
 
- ser_baud=xxx    Set serial line baud rate for console.
+ ser_baud=xxx    Enable serial I/O and set the baud rate.
 
  dom0_mem=xxx    Set the initial amount of memory for domain0.
                  
@@ -358,12 +357,12 @@ title Xen / XenoLinux 2.4.22
         module /boot/xenolinux.gz root=/dev/sda4 ro console=tty0
 
 The first line specifies which Xen image to use, and what command line
-arguments to pass to Xen. In this case, we set the maximum amount of
-memory to allocate to domain0, and the serial baud rate (the default
-is 9600 baud). We could also disable smp support (nosmp) or disable
-hyper-threading support (noht). If you have multiple network interface
-you can use ifname=ethXX to select which one to use. If your network
-card is unsupported, use ifname=dummy
+arguments to pass to Xen. In this case we set the maximum amount of
+memory to allocate to domain0, and enable serial I/O at 9600 baud.
+We could also disable smp support (nosmp) or disable hyper-threading
+support (noht). If you have multiple network interface you can use
+ifname=ethXX to select which one to use. If your network card is
+unsupported, use ifname=dummy
 
 The second line specifies which xenolinux image to use, and the
 standard linux command line arguments to pass to the kernel. In this
@@ -416,8 +415,9 @@ Debugging
 ---------
 
 Xen has a set of debugging features that can be useful to try and
-figure out what's going on. Hit 'h' on the serial line or ScrollLock-h
-on the keyboard to get a list of supported commands. 
+figure out what's going on. Hit 'h' on the serial line (if you
+specified a baud rate on the Xen command line) or ScrollLock-h on the
+keyboard to get a list of supported commands.
 
 If you have a crash you'll likely get a crash dump containing an EIP
 (PC) which, along with an 'objdump -d image', can be useful in
index 7b384a90ca41fa434a275df03a4f5d269d956809..032c96236e0e21ab8db7d89d2ed180a0e4616380 100644 (file)
@@ -48,7 +48,8 @@ void start_of_day(void);
 /* opt_console: If true, Xen sends logging to the VGA console. */
 int opt_console = 1;
 /* opt_ser_baud: Baud rate at which logging is sent to COM1. */
-unsigned int opt_ser_baud = 9600;
+/* NB. Default (0) means that serial I/O is disabled. */
+unsigned int opt_ser_baud = 0;
 /* opt_dom0_mem: Kilobytes of memory allocated to domain 0. */
 unsigned int opt_dom0_mem = 16000;
 /* opt_ifname: Name of physical network interface to use. */
@@ -232,6 +233,9 @@ void cmain (unsigned long magic, multiboot_info_t *mbi)
 
 void init_serial(void)
 {
+    if ( !SERIAL_ENABLED )
+        return;
+
     /* 'opt_ser_baud' baud, no parity, 1 stop bit, 8 data bits. */
     outb(0x83, SERIAL_BASE+DATA_FORMAT);
     outb(115200/opt_ser_baud, SERIAL_BASE+DIVISOR_LO);
@@ -249,6 +253,8 @@ void init_serial(void)
 #ifdef CONFIG_OUTPUT_SERIAL
 void putchar_serial(unsigned char c)
 {
+    if ( !SERIAL_ENABLED )
+        return;
     if ( c == '\n' ) putchar_serial('\r');
     while ( !(inb(SERIAL_BASE+LINE_STATUS)&(1<<5)) ) barrier();
     outb(c, SERIAL_BASE+TX_HOLD);
index 2d0d3a2f5a338273055971d6de14409dad5821ce..c6457bf998ecb80648590a0beadf95e9c81acb00 100644 (file)
@@ -71,6 +71,9 @@ static void serial_rx_int(int irq, void *dev_id, struct pt_regs *regs)
 void initialize_serial() 
 {
     int rc; 
+
+    if ( !SERIAL_ENABLED )
+        return;
     
     /* setup key handler */
     add_key_handler('~', toggle_echo, "toggle serial echo");
index b4935f706f6fbbbcd88c3aa9577ce8e596c5412a..a4a62cafe20497c01d09f0efb0916b3c77fa68ff 100644 (file)
 #define capable(_c) 0
 
 #ifndef __ASSEMBLY__
+
 extern unsigned long _end; /* standard ELF symbol */
 extern void __out_of_line_bug(int line) __attribute__((noreturn));
 #define out_of_line_bug() __out_of_line_bug(__LINE__)
-#endif
+
+extern unsigned int opt_ser_baud;
+#define SERIAL_ENABLED (opt_ser_baud != 0)
+
+#endif /* __ASSEMBLY__ */
 
 #endif /* __XENO_CONFIG_H__ */