aboutsummaryrefslogtreecommitdiff
path: root/src/output.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2008-06-21 12:15:10 -0400
committerKevin O'Connor <kevin@koconnor.net>2008-06-21 12:15:10 -0400
commit61d6b06696b7efc6e6bc1df6573ba58e743d6ae3 (patch)
treeb1c58d048abcbb27fe6130554828db45c803aded /src/output.c
parentdb03d5db185430812775f0075a18da459b96a019 (diff)
downloadseabios-hppa-61d6b06696b7efc6e6bc1df6573ba58e743d6ae3.zip
seabios-hppa-61d6b06696b7efc6e6bc1df6573ba58e743d6ae3.tar.gz
seabios-hppa-61d6b06696b7efc6e6bc1df6573ba58e743d6ae3.tar.bz2
Init serial port before using it for debug - also reinit after option rom.
Apparently, some VGA option roms will enable serial irqs - this could cause problems with spurious irqs from debug messages. Also, improve debugging of option roms that fail the checksum check.
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/output.c b/src/output.c
index 054082f..dd647a2 100644
--- a/src/output.c
+++ b/src/output.c
@@ -13,6 +13,25 @@
#define DEBUG_PORT 0x03f8
#define DEBUG_TIMEOUT 100000
+void
+debug_serial_setup()
+{
+ if (!CONFIG_DEBUG_SERIAL)
+ return;
+ // setup for serial logging: 8N1
+ u8 oldparam, newparam = 0x03;
+ oldparam = inb(DEBUG_PORT+3);
+ outb(newparam, DEBUG_PORT+3);
+ // Disable irqs
+ u8 oldier, newier = 0;
+ oldier = inb(DEBUG_PORT+1);
+ outb(newier, DEBUG_PORT+1);
+
+ if (oldparam != newparam || oldier != newier)
+ dprintf(1, "Changing serial settings was %x/%x now %x/%x\n"
+ , oldparam, oldier, newparam, newier);
+}
+
static void
debug_serial(char c)
{