aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-09-22 22:14:13 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2003-09-22 22:14:13 +0000
commit4cbc390bba6f7c15f95a1804516d7d42e41b2cec (patch)
tree636ce885f9df16c9dfc87bd31568282466cbe199
parent3c64421304ae2b2ca8e8e0a883c621f4b67ec603 (diff)
downloadxen-4cbc390bba6f7c15f95a1804516d7d42e41b2cec.tar.gz
xen-4cbc390bba6f7c15f95a1804516d7d42e41b2cec.tar.bz2
xen-4cbc390bba6f7c15f95a1804516d7d42e41b2cec.zip
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.
-rw-r--r--README.CD32
-rw-r--r--xen/common/kernel.c8
-rw-r--r--xen/drivers/char/xen_serial.c3
-rw-r--r--xen/include/xeno/config.h7
4 files changed, 32 insertions, 18 deletions
diff --git a/README.CD b/README.CD
index 99f1ea170f..a6fc77c47b 100644
--- 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
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index 7b384a90ca..032c96236e 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -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);
diff --git a/xen/drivers/char/xen_serial.c b/xen/drivers/char/xen_serial.c
index 2d0d3a2f5a..c6457bf998 100644
--- a/xen/drivers/char/xen_serial.c
+++ b/xen/drivers/char/xen_serial.c
@@ -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");
diff --git a/xen/include/xeno/config.h b/xen/include/xeno/config.h
index b4935f706f..a4a62cafe2 100644
--- a/xen/include/xeno/config.h
+++ b/xen/include/xeno/config.h
@@ -146,9 +146,14 @@
#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__ */