]> xenbits.xensource.com Git - seabios.git/commitdiff
debug: Add runtime option to not report the debug serial port to the OS.
authorKevin O'Connor <kevin@koconnor.net>
Wed, 15 Jan 2014 18:34:19 +0000 (13:34 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 22 Jan 2014 22:30:30 +0000 (17:30 -0500)
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>
src/serial.c

index 9b6d29f1b63a9f762d8a62c15aa605c75983a6e2..00c6eb7db7a02f329a0de91474ae8a04da7c2e6c 100644 (file)
@@ -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)