From 7123d9834d58287d43514d7799ed1a7b34eea243 Mon Sep 17 00:00:00 2001 From: Julian Pidancet Date: Wed, 1 Feb 2012 16:03:24 +0000 Subject: [PATCH] Introduce config option to select which IO port to send debug output on 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 --- src/Kconfig | 17 +++++++++++++++++ src/output.c | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Kconfig b/src/Kconfig index 4270014..cf0bff0 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -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 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); -- 2.25.1