Introduce config option to select which IO port to send debug output on
authorJulian Pidancet <julian.pidancet@citrix.com>
Wed, 1 Feb 2012 16:03:24 +0000 (16:03 +0000)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 2 Feb 2012 03:00:34 +0000 (22:00 -0500)
Introduce CONFIG_DEBUG_IO_PORT config option which allow user
to choose on which port to send debug on at configure time.

Bochs users are likely to use 0x402 (default) for debugging purposes,
whereas Xen uses 0xe9, as IO port address.

Signed-off-by: Julian Pidancet <julian.pidancet@citrix.com>
src/Kconfig
src/output.c

index 427001457e27afeb9a340bc2bcc47186c6dc5452..cf0bff09b7d5140cae1a7ecb8a4890686686b0f8 100644 (file)
@@ -348,4 +348,21 @@ menu "Debugging"
         default 0x3f8
         help
             Base port for serial - generally 0x3f8, 0x2f8, 0x3e8, or 0x2e8.
+
+    config DEBUG_IO
+        depends on !COREBOOT && DEBUG_LEVEL != 0
+        bool "Special IO port debugging"
+        default y
+        help
+            Some emulators or hypervisors provide with a way to output debug
+            information by outputing strings in a special port present in the
+            IO space.
+
+    config DEBUG_IO_PORT
+        depends on DEBUG_IO
+        hex "Debug IO port address"
+        default 0x0402
+        help
+            Bochs uses the 0x0402 address by default, whereas Xen
+            makes the 0xe9 IO address available for guests use.
 endmenu
index 462ffb773d9c74f3ffb889ac508f526abe0660df..bdde7ccaa4fbac2c5ec12700c152c0de9fc58203 100644 (file)
@@ -75,9 +75,9 @@ putc_debug(struct putcinfo *action, char c)
 {
     if (! CONFIG_DEBUG_LEVEL)
         return;
-    if (! CONFIG_COREBOOT)
+    if (CONFIG_DEBUG_IO)
         // Send character to debug port.
-        outb(c, PORT_BIOS_DEBUG);
+        outb(c, CONFIG_DEBUG_IO_PORT);
     if (c == '\n')
         debug_serial('\r');
     debug_serial(c);