aboutsummaryrefslogtreecommitdiff
path: root/src/serial.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-01-15 13:34:19 -0500
committerKevin O'Connor <kevin@koconnor.net>2014-01-22 17:30:30 -0500
commitcf85418f7825a2a6712f8feb0ab7e37c55323eb3 (patch)
tree7265608d227637a821a69846202e309c3224434b /src/serial.c
parent406df19d9962a66e64bd0cce5b1041ae7bc5bfd1 (diff)
downloadseabios-hppa-cf85418f7825a2a6712f8feb0ab7e37c55323eb3.zip
seabios-hppa-cf85418f7825a2a6712f8feb0ab7e37c55323eb3.tar.gz
seabios-hppa-cf85418f7825a2a6712f8feb0ab7e37c55323eb3.tar.bz2
debug: Add runtime option to not report the debug serial port to the OS.
DOS resets the serial ports reported by the BIOS. This can mess up debugging and timing when the serial baud rate changes on the debug port. The new "etc/advertise-serial-debug-port" option allows one to suppress the debug serial port from the normal list of serial ports the BIOS reports to DOS. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/serial.c')
-rw-r--r--src/serial.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/serial.c b/src/serial.c
index 9b6d29f..00c6eb7 100644
--- a/src/serial.c
+++ b/src/serial.c
@@ -9,6 +9,7 @@
#include "bregs.h" // struct bregs
#include "hw/serialio.h" // SEROFF_IER
#include "output.h" // debug_enter
+#include "romfile.h" // romfile_loadint
#include "stacks.h" // yield
#include "util.h" // serial_setup
@@ -20,6 +21,9 @@
static u16
detect_serial(u16 port, u8 timeout, u8 count)
{
+ if (CONFIG_DEBUG_SERIAL && port == CONFIG_DEBUG_SERIAL_PORT
+ && !romfile_loadint("etc/advertise-serial-debug-port", 1))
+ return 0;
outb(0x02, port+SEROFF_IER);
u8 ier = inb(port+SEROFF_IER);
if (ier != 0x02)