[SeaBIOS] [PATCH v2] Introduce config option to select which IO port to send debug output on

julian.pidancet at gmail.com julian.pidancet at gmail.com
Wed Feb 1 17:03:24 CET 2012


From: Julian Pidancet <julian.pidancet at citrix.com>

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.

v2: Typo.

Signed-off-by: Julian Pidancet <julian.pidancet at citrix.com>
---
 src/Kconfig  |   18 ++++++++++++++++++
 src/output.c |    4 ++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/Kconfig b/src/Kconfig
index 9ea48bb..f57899b 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -348,4 +348,22 @@ 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
diff --git a/src/output.c b/src/output.c
index 462ffb7..bdde7cc 100644
--- a/src/output.c
+++ b/src/output.c
@@ -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);
-- 
Julian Pidancet




More information about the SeaBIOS mailing list